summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2022-05-07 12:48:29 +0100
committerBram Moolenaar <Bram@vim.org>2022-05-07 12:48:29 +0100
commit79d599b8772022af1d657f368c2fc97aa342c0da (patch)
treeee415de85697c73717db8ca0679481349d097965 /runtime
parentc27747e6ddcbda7d1d3b39867898f746dc4db471 (diff)
patch 8.2.4903: cannot get the current cmdline completion type and positionv8.2.4903
Problem: Cannot get the current cmdline completion type and position. Solution: Add getcmdcompltype() and getcmdscreenpos(). (Shougo Matsushita, closes #10344)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/builtin.txt20
-rw-r--r--runtime/doc/usr_41.txt4
2 files changed, 24 insertions, 0 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 12fb509a78..acd0f5caa3 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -213,8 +213,12 @@ getcharmod() Number modifiers for the last typed character
getcharpos({expr}) List position of cursor, mark, etc.
getcharsearch() Dict last character search
getcharstr([expr]) String get one character from the user
+getcmdcompltype() String return the type of the current
+ command-line completion
getcmdline() String return the current command-line
getcmdpos() Number return cursor position in command-line
+getcmdscreenpos() Number return cursor screen position in
+ command-line
getcmdtype() String return current command-line type
getcmdwintype() String return current command-line window type
getcompletion({pat}, {type} [, {filtered}])
@@ -3208,6 +3212,13 @@ getcharstr([expr]) *getcharstr()*
Otherwise this works like |getchar()|, except that a number
result is converted to a string.
+getcmdcompltype() *getcmdcompltype()*
+ 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()| and |getcmdline()|.
+ Returns an empty string when completion is not defined.
getcmdline() *getcmdline()*
Return the current command-line. Only works when the command
@@ -3227,6 +3238,15 @@ getcmdpos() *getcmdpos()*
Returns 0 otherwise.
Also see |getcmdtype()|, |setcmdpos()| and |getcmdline()|.
+getcmdscreenpos() *getcmdscreenpos()*
+ Return the screen position of the cursor in the command line
+ as a byte count. The first column is 1.
+ Instead of |getcmdpos()|, it adds the prompt position.
+ Only works when editing the command line, thus requires use of
+ |c_CTRL-\_e| or |c_CTRL-R_=| or an expression mapping.
+ Returns 0 otherwise.
+ Also see |getcmdpos()|, |setcmdpos()|.
+
getcmdtype() *getcmdtype()*
Return the current command-line type. Possible return values
are:
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index a9a1fcd883..1102f7e1a0 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -976,8 +976,12 @@ Buffers, windows and the argument list:
swapname() get the swap file path of a buffer
Command line: *command-line-functions*
+ getcmdcompltype() get the type of the current command line
+ completion
getcmdline() get the current command line
getcmdpos() get position of the cursor in the command line
+ getcmdscreenpos() get screen position of the cursor in the
+ command line
setcmdpos() set position of the cursor in the command line
getcmdtype() return the current command-line type
getcmdwintype() return the current command-line window type