aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorFamiu Haque <famiuhaque@protonmail.com>2022-07-14 14:37:00 +0600
committerFamiu Haque <famiuhaque@protonmail.com>2022-08-19 09:27:52 +0600
commitc2f7a2a18daa7e1d80285818065b2376683dcb21 (patch)
treec6531a580f1ec3dcc27750001247852739674bcb /runtime
parent9a3877ff9d4db15189b171b4a487d57768abf0a9 (diff)
downloadrneovim-c2f7a2a18daa7e1d80285818065b2376683dcb21.tar.gz
rneovim-c2f7a2a18daa7e1d80285818065b2376683dcb21.tar.bz2
rneovim-c2f7a2a18daa7e1d80285818065b2376683dcb21.zip
feat: multibuffer preview support for inccommand
Allows preview callbacks to modify multiple buffers in order to show the preview. Previously, if multiple buffers were modified, only the current buffer would have its state restored. After this change, all buffers have their state restored after preview. Closes #19103.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/map.txt8
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 00e5cc6e27..2b2bfec6c7 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1466,10 +1466,10 @@ results (for "inccommand=split", or nil for "inccommand=nosplit").
Your command preview routine must implement this protocol:
-1. Modify the current buffer as required for the preview (see
+1. Modify the target buffers as required for the preview (see
|nvim_buf_set_text()| and |nvim_buf_set_lines()|).
2. If preview buffer is provided, add necessary text to the preview buffer.
-3. Add required highlights to the current buffer. If preview buffer is
+3. Add required highlights to the target buffers. If preview buffer is
provided, add required highlights to the preview buffer as well. All
highlights must be added to the preview namespace which is provided as an
argument to the preview callback (see |nvim_buf_add_highlight()| and
@@ -1480,8 +1480,8 @@ Your command preview routine must implement this protocol:
2: Preview is shown and preview window is opened (if "inccommand=split").
For "inccommand=nosplit" this is the same as 1.
-After preview ends, Nvim discards all changes to the buffer and all highlights
-in the preview namespace.
+After preview ends, Nvim discards all changes to all buffers made during the
+preview and clears all highlights in the preview namespace.
Here's an example of a command to trim trailing whitespace from lines that
supports incremental command preview: