diff options
Diffstat (limited to 'runtime/doc/map.txt')
-rw-r--r-- | runtime/doc/map.txt | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 11048aee30..52c04333fc 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -12,7 +12,7 @@ manual. Type |gO| to see the table of contents. ============================================================================== -1. Key mapping *key-mapping* *mapping* *macro* +1. Key mapping *keybind* *key-mapping* *mapping* Key mapping is used to change the meaning of typed keys. The most common use is to define a sequence of commands for a function key. Example: > @@ -1545,7 +1545,7 @@ Your command preview routine must implement this protocol: 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 + argument to the preview callback (see |vim.hl.range()| and |nvim_buf_set_extmark()| for help on how to add highlights to a namespace). 4. Return an integer (0, 1, 2) which controls how Nvim behaves as follows: 0: No preview is shown. @@ -1574,13 +1574,12 @@ supports incremental command preview: if start_idx then -- Highlight the match - vim.api.nvim_buf_add_highlight( + vim.hl.range( buf, preview_ns, 'Substitute', - line1 + i - 2, - start_idx - 1, - end_idx + {line1 + i - 2, start_idx - 1}, + {line1 + i - 2, end_idx}, ) -- Add lines and set highlights in the preview buffer @@ -1595,13 +1594,12 @@ supports incremental command preview: false, { prefix .. line } ) - vim.api.nvim_buf_add_highlight( + vim.hl.range( preview_buf, preview_ns, 'Substitute', - preview_buf_line, - #prefix + start_idx - 1, - #prefix + end_idx + {preview_buf_line, #prefix + start_idx - 1}, + {preview_buf_line, #prefix + end_idx}, ) preview_buf_line = preview_buf_line + 1 end |