aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_meta/vimfn.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-07-06 08:41:41 +0800
committerzeertzjq <zeertzjq@outlook.com>2025-07-06 08:55:32 +0800
commit9c04eb02adde4f7daae2c4986ed58037358ce4ad (patch)
treed13077c3ad929a20ed2b046679502141791e5128 /runtime/lua/vim/_meta/vimfn.lua
parent6ebcb4a4d6ce8c3b1f405c144a0e398c9e6bf068 (diff)
downloadrneovim-9c04eb02adde4f7daae2c4986ed58037358ce4ad.tar.gz
rneovim-9c04eb02adde4f7daae2c4986ed58037358ce4ad.tar.bz2
rneovim-9c04eb02adde4f7daae2c4986ed58037358ce4ad.zip
vim-patch:9.1.1509: patch 9.1.1505 was not good
Problem: Patch 9.1.1505 was not good Solution: Revert "patch 9.1.1505: not possible to return completion type for :ex command" and instead add the getcompletiontype() function (Hirohito Higashi). related: vim/vim#17606 closes: vim/vim#17662 https://github.com/vim/vim/commit/96b3ef23896ce70b2fdf3425ba2c013ce2840db6 Cherry-pick Test_multibyte_expression() from Vim, as it passes. Co-authored-by: Hirohito Higashi <h.east.727@gmail.com> Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Diffstat (limited to 'runtime/lua/vim/_meta/vimfn.lua')
-rw-r--r--runtime/lua/vim/_meta/vimfn.lua23
1 files changed, 17 insertions, 6 deletions
diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua
index 9f82fe41ff..d690eaa34a 100644
--- a/runtime/lua/vim/_meta/vimfn.lua
+++ b/runtime/lua/vim/_meta/vimfn.lua
@@ -2994,18 +2994,19 @@ function vim.fn.getcharstr(expr, opts) end
--- @return string
function vim.fn.getcmdcomplpat() end
---- Return the type of command-line completion using {pat}.
---- If {pat} is omited, only works when the command line is being
---- edited, thus requires use of |c_CTRL-\_e| or |c_CTRL-R_=|.
----
+--- Return the type of the current command-line completion.
+--- Only works when the command line is being edited, thus
+--- requires use of |c_CTRL-\_e| or |c_CTRL-R_=|.
--- See |:command-completion| for the return string.
--- Also see |getcmdtype()|, |setcmdpos()|, |getcmdline()|,
--- |getcmdprompt()|, |getcmdcomplpat()| and |setcmdline()|.
--- Returns an empty string when completion is not defined.
---
---- @param pat? string
+--- To get the type of the command-line completion for the
+--- specified string, use |getcompletiontype()|.
+---
--- @return string
-function vim.fn.getcmdcompltype(pat) end
+function vim.fn.getcmdcompltype() end
--- Return the current command-line input. Only works when the
--- command line is being edited, thus requires use of
@@ -3154,6 +3155,16 @@ function vim.fn.getcmdwintype() end
--- @return string[]
function vim.fn.getcompletion(pat, type, filtered) end
+--- Return the type of the command-line completion using {pat}.
+--- When no corresponding completion type is found, an empty
+--- string is returned.
+--- To get the current command-line completion type, use
+--- |getcmdcompltype()|.
+---
+--- @param pat string
+--- @return string
+function vim.fn.getcompletiontype(pat) end
+
--- Get the position of the cursor. This is like getpos('.'), but
--- includes an extra "curswant" item in the list:
--- [0, lnum, col, off, curswant] ~