aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_meta/api.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2025-08-29 10:33:15 +0200
committerGitHub <noreply@github.com>2025-08-29 10:33:15 +0200
commit772f1966a348eb26bc9cb17d45bbdb739642ccdb (patch)
treeb60729b176bfa75007c259b67e7c60aba198b7ff /runtime/lua/vim/_meta/api.lua
parent19f2e5c3eb4194a4b4255abb01991af63c1979b3 (diff)
parent5edbabdbec0ac3fba33be8afc008845130158583 (diff)
downloadrneovim-772f1966a348eb26bc9cb17d45bbdb739642ccdb.tar.gz
rneovim-772f1966a348eb26bc9cb17d45bbdb739642ccdb.tar.bz2
rneovim-772f1966a348eb26bc9cb17d45bbdb739642ccdb.zip
Merge pull request #31400 from vanaigr/decor-provider-range
feat(decor): add range-based highlighting
Diffstat (limited to 'runtime/lua/vim/_meta/api.lua')
-rw-r--r--runtime/lua/vim/_meta/api.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua
index b7132e5c40..cb552554cb 100644
--- a/runtime/lua/vim/_meta/api.lua
+++ b/runtime/lua/vim/_meta/api.lua
@@ -2128,7 +2128,7 @@ function vim.api.nvim_set_current_win(window) end
--- Note: this function should not be called often. Rather, the callbacks
--- themselves can be used to throttle unneeded callbacks. the `on_start`
--- callback can return `false` to disable the provider until the next redraw.
---- Similarly, return `false` in `on_win` will skip the `on_line` calls
+--- Similarly, return `false` in `on_win` will skip the `on_line` and `on_range` calls
--- for that window (but any extmarks set in `on_win` will still be used).
--- A plugin managing multiple sources of decoration should ideally only set
--- one provider, and merge the sources internally. You can use multiple `ns_id`
@@ -2140,7 +2140,7 @@ function vim.api.nvim_set_current_win(window) end
--- Doing `vim.rpcnotify` should be OK, but `vim.rpcrequest` is quite dubious
--- for the moment.
---
---- Note: It is not allowed to remove or update extmarks in `on_line` callbacks.
+--- Note: It is not allowed to remove or update extmarks in `on_line` or `on_range` callbacks.
---
--- @param ns_id integer Namespace id from `nvim_create_namespace()`
--- @param opts vim.api.keyset.set_decoration_provider Table of callbacks:
@@ -2162,6 +2162,14 @@ function vim.api.nvim_set_current_win(window) end
--- ```
--- ["line", winid, bufnr, row]
--- ```
+--- - on_range: called for each buffer range being redrawn.
+--- Range is end-exclusive and may span multiple lines. Range
+--- bounds point to the first byte of a character. An end position
+--- of the form (lnum, 0), including (number of lines, 0), is valid
+--- and indicates that EOL of the preceding line is included.
+--- ```
+--- ["range", winid, bufnr, begin_row, begin_col, end_row, end_col]
+--- ```
--- - on_end: called at the end of a redraw cycle
--- ```
--- ["end", tick]