aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2023-03-25 02:24:24 +0100
committerLuuk van Baal <luukvbaal@gmail.com>2023-04-01 13:59:03 +0200
commit2a10f64e254375e77e1c5a6aeae3cd65cd122afb (patch)
tree5b3cc58c001d4a47de52796274dd7b2dcf51b0a8 /runtime
parent2257ade3dc2daab5ee12d27807c0b3bcf103cd29 (diff)
downloadrneovim-2a10f64e254375e77e1c5a6aeae3cd65cd122afb.tar.gz
rneovim-2a10f64e254375e77e1c5a6aeae3cd65cd122afb.tar.bz2
rneovim-2a10f64e254375e77e1c5a6aeae3cd65cd122afb.zip
feat(extmarks): extend nvim_buf_get_extmarks()
Problem: Can not get all extmarks in a buffer. Properties are missing from the details array. Solution: Allow getting all extmarks in a buffer by supplying a -1 "ns_id". Add missing properties to the details array.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/api.txt11
-rw-r--r--runtime/doc/news.txt5
2 files changed, 14 insertions, 2 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index ea57db22e0..cc887ad024 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -2527,6 +2527,8 @@ nvim_buf_get_extmark_by_id({buffer}, {ns_id}, {id}, {opts})
• {id} Extmark id
• {opts} Optional parameters. Keys:
• details: Whether to include the details dict
+ • hl_name: Whether to include highlight group name instead
+ of id, true if omitted
Return: ~
0-indexed (row, col) tuple or empty list () if extmark id was absent
@@ -2563,7 +2565,8 @@ nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {opts})
Parameters: ~
• {buffer} Buffer handle, or 0 for current buffer
- • {ns_id} Namespace id from |nvim_create_namespace()|
+ • {ns_id} Namespace id from |nvim_create_namespace()| or -1 for all
+ namespaces
• {start} Start of range: a 0-indexed (row, col) or valid extmark id
(whose position defines the bound). |api-indexing|
• {end} End of range (inclusive): a 0-indexed (row, col) or valid
@@ -2571,7 +2574,11 @@ nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {opts})
|api-indexing|
• {opts} Optional parameters. Keys:
• limit: Maximum number of marks to return
- • details Whether to include the details dict
+ • details: Whether to include the details dict
+ • hl_name: Whether to include highlight group name instead
+ of id, true if omitted
+ • type: Filter marks by type: "highlight", "sign",
+ "virt_text" and "virt_lines"
Return: ~
List of [extmark_id, row, col] tuples in "traversal order".
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 890a033268..7efb0ab36f 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -67,6 +67,11 @@ NEW FEATURES *news-features*
The following new APIs or features were added.
+• |nvim_buf_get_extmarks()| now accepts a -1 `ns_id` to request extmarks from
+ all namespaces and adds the namespace id to the details array.
+ Other missing properties have been added to the details array and marks can
+ be filtered by type.
+
• Added a new experimental |lua-loader| that byte-compiles and caches lua files.
To enable the new loader, add the following at the top of your |init.lua|: >lua
vim.loader.enable()