aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorglepnir <glephunter@gmail.com>2024-12-31 19:12:50 +0800
committerGitHub <noreply@github.com>2024-12-31 19:12:50 +0800
commitbdc0b5f5054afb8ba3418f9d6c9b1b3e944f3e3a (patch)
tree5c0326a9ffb1b03bb6db73cf37f4e9478665874f /runtime
parent57f10abbc2c17453ffe584833abb7596e9897a6e (diff)
downloadrneovim-bdc0b5f5054afb8ba3418f9d6c9b1b3e944f3e3a.tar.gz
rneovim-bdc0b5f5054afb8ba3418f9d6c9b1b3e944f3e3a.tar.bz2
rneovim-bdc0b5f5054afb8ba3418f9d6c9b1b3e944f3e3a.zip
vim-patch:9.1.0983: not able to get the displayed items in complete_i… (#31796)
vim-patch:9.1.0983: not able to get the displayed items in complete_info() Problem: not able to get the displayed items in complete_info() (Evgeni Chasnovski) Solution: return the visible items via the "matches" key for complete_info() (glepnir) fixes: vim/vim#10007 closes: vim/vim#16307 https://github.com/vim/vim/commit/d4088edae21659e14ab5f763c820f4eab9d36981
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/builtin.txt9
-rw-r--r--runtime/doc/insert.txt1
-rw-r--r--runtime/lua/vim/_meta/vimfn.lua9
3 files changed, 15 insertions, 4 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 0e9c1c8512..f321c880a4 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -1174,10 +1174,15 @@ complete_info([{what}]) *complete_info()*
See |complete_info_mode| for the values.
pum_visible |TRUE| if popup menu is visible.
See |pumvisible()|.
- items List of completion matches. Each item is a
- dictionary containing the entries "word",
+ items List of all completion candidates. Each item
+ is a dictionary containing the entries "word",
"abbr", "menu", "kind", "info" and "user_data".
See |complete-items|.
+ matches Same as "items", but only returns items that
+ are matching current query. If both "matches"
+ and "items" are in "what", the returned list
+ will still be named "items", but each item
+ will have an additional "match" field.
selected Selected item index. First index is zero.
Index is -1 if no item is selected (showing
typed text only, or the last completion after
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index d3b822e72b..bc0e9ba314 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -1189,6 +1189,7 @@ items:
|hl-PmenuKind| highlight group, allowing for the
customization of ctermfg and guifg properties for the
completion kind
+ match See "matches" in |complete_info()|.
All of these except "icase", "equal", "dup" and "empty" must be a string. If
an item does not meet these requirements then an error message is given and
diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua
index b580357c85..6662fca84f 100644
--- a/runtime/lua/vim/_meta/vimfn.lua
+++ b/runtime/lua/vim/_meta/vimfn.lua
@@ -1023,10 +1023,15 @@ function vim.fn.complete_check() end
--- See |complete_info_mode| for the values.
--- pum_visible |TRUE| if popup menu is visible.
--- See |pumvisible()|.
---- items List of completion matches. Each item is a
---- dictionary containing the entries "word",
+--- items List of all completion candidates. Each item
+--- is a dictionary containing the entries "word",
--- "abbr", "menu", "kind", "info" and "user_data".
--- See |complete-items|.
+--- matches Same as "items", but only returns items that
+--- are matching current query. If both "matches"
+--- and "items" are in "what", the returned list
+--- will still be named "items", but each item
+--- will have an additional "match" field.
--- selected Selected item index. First index is zero.
--- Index is -1 if no item is selected (showing
--- typed text only, or the last completion after