aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-11-08 12:17:25 +0100
committerGitHub <noreply@github.com>2023-11-08 12:17:25 +0100
commit1b0fd377aba3b4d076e4dbfb5adb96866a4982d1 (patch)
tree460bbeada52d9b7bd3a1ad194224cec461f7f055 /runtime
parent4c8fdc018b428c4b5f35215a1189d2cd55cd5888 (diff)
parent4e6f559b8c5f77924fdbe2e5abd9c6aa8efad13f (diff)
downloadrneovim-1b0fd377aba3b4d076e4dbfb5adb96866a4982d1.tar.gz
rneovim-1b0fd377aba3b4d076e4dbfb5adb96866a4982d1.tar.bz2
rneovim-1b0fd377aba3b4d076e4dbfb5adb96866a4982d1.zip
Merge pull request #25767 from luukvbaal/signdel
feat(extmarks): add 'invalidate' property
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/api.txt8
-rw-r--r--runtime/doc/news.txt3
-rw-r--r--runtime/lua/vim/_meta/api.lua8
-rw-r--r--runtime/lua/vim/_meta/api_keysets.lua2
4 files changed, 19 insertions, 2 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index edf683473f..b38524bd55 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -2707,6 +2707,12 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {*opts})
the extmark end position (if it exists) will be shifted in
when new text is inserted (true for right, false for
left). Defaults to false.
+ • undo_restore : Restore the exact position of the mark if
+ text around the mark was deleted and then restored by
+ undo. Defaults to true.
+ • invalidate : boolean that indicates whether to hide the
+ extmark if the entirety of its range is deleted. If
+ "undo_restore" is false, the extmark is deleted instead.
• priority: a priority value for the highlight group or sign
attribute. For example treesitter highlighting uses a
value of 100.
@@ -2777,7 +2783,7 @@ nvim_set_decoration_provider({ns_id}, {*opts})
|nvim_buf_set_extmark()| can be called to add marks on a per-window or
per-lines basis. Use the `ephemeral` key to only use the mark for the
current screen redraw (the callback will be called again for the next
- redraw ).
+ redraw).
Note: this function should not be called often. Rather, the callbacks
themselves can be used to throttle unneeded callbacks. the `on_start`
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 985adb5b0d..ac84f59308 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -279,6 +279,9 @@ The following changes to existing APIs or features add new behavior.
• Extmarks can opt-out of precise undo tracking using the new "undo_restore"
flag to |nvim_buf_set_extmark()|
+• Extmarks can be automatically hidden or removed using the new "invalidate"
+ flag to |nvim_buf_set_extmark()|
+
• LSP hover and signature help now use Treesitter for highlighting of Markdown
content.
Note that syntax highlighting of code examples requires a matching parser
diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua
index 0bee27970d..2142a429a2 100644
--- a/runtime/lua/vim/_meta/api.lua
+++ b/runtime/lua/vim/_meta/api.lua
@@ -554,6 +554,12 @@ function vim.api.nvim_buf_line_count(buffer) end
--- the extmark end position (if it exists) will be shifted in
--- when new text is inserted (true for right, false for
--- left). Defaults to false.
+--- • undo_restore : Restore the exact position of the mark if
+--- text around the mark was deleted and then restored by
+--- undo. Defaults to true.
+--- • invalidate : boolean that indicates whether to hide the
+--- extmark if the entirety of its range is deleted. If
+--- "undo_restore" is false, the extmark is deleted instead.
--- • priority: a priority value for the highlight group or sign
--- attribute. For example treesitter highlighting uses a
--- value of 100.
@@ -1812,7 +1818,7 @@ function vim.api.nvim_set_current_win(window) end
--- `nvim_buf_set_extmark()` can be called to add marks on a per-window or
--- per-lines basis. Use the `ephemeral` key to only use the mark for the
--- current screen redraw (the callback will be called again for the next
---- redraw ).
+--- redraw).
--- 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.
diff --git a/runtime/lua/vim/_meta/api_keysets.lua b/runtime/lua/vim/_meta/api_keysets.lua
index 467409505e..f69e5a92c7 100644
--- a/runtime/lua/vim/_meta/api_keysets.lua
+++ b/runtime/lua/vim/_meta/api_keysets.lua
@@ -227,6 +227,7 @@ error('Cannot require a meta file')
--- @field virt_text_hide? boolean
--- @field hl_eol? boolean
--- @field hl_mode? string
+--- @field invalidate? boolean
--- @field ephemeral? boolean
--- @field priority? integer
--- @field right_gravity? boolean
@@ -243,6 +244,7 @@ error('Cannot require a meta file')
--- @field conceal? string
--- @field spell? boolean
--- @field ui_watched? boolean
+--- @field undo_restore? boolean
--- @class vim.api.keyset.user_command
--- @field addr? any