aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2021-12-25 06:56:33 +0800
committerzeertzjq <zeertzjq@outlook.com>2021-12-25 07:42:06 +0800
commit8eff0ca6d50bf2ef0897a08f5fdbc0abed7c1266 (patch)
treef7622e277f4acf39ec8bc061cf983001ffc26176 /runtime
parent0d7a97224f28cdf47d7ecc80b6d300c8c67c0b29 (diff)
downloadrneovim-8eff0ca6d50bf2ef0897a08f5fdbc0abed7c1266.tar.gz
rneovim-8eff0ca6d50bf2ef0897a08f5fdbc0abed7c1266.tar.bz2
rneovim-8eff0ca6d50bf2ef0897a08f5fdbc0abed7c1266.zip
vim-patch:8.2.2468: not easy to get the full command name from a shortened one
Problem: Not easy to get the full command name from a shortened one. Solution: Add fullcommand(). (Martin Tournoij, closes vim/vim#7777) https://github.com/vim/vim/commit/038e09ee7645731de0296d255aabb17603276443
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/eval.txt20
-rw-r--r--runtime/doc/usr_41.txt1
2 files changed, 19 insertions, 2 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index aef303195d..9a2b9f5069 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2410,10 +2410,11 @@ foldlevel({lnum}) Number fold level at {lnum}
foldtext() String line displayed for closed fold
foldtextresult({lnum}) String text for closed fold at {lnum}
foreground() Number bring the Vim window to the foreground
+fullcommand({name}) String get full command from {name}
funcref({name} [, {arglist}] [, {dict}])
- Funcref reference to function {name}
+ Funcref reference to function {name}
function({name} [, {arglist}] [, {dict}])
- Funcref named reference to function {name}
+ Funcref named reference to function {name}
garbagecollect([{atexit}]) none free memory, breaking cyclic references
get({list}, {idx} [, {def}]) any get item {idx} from {list} or {def}
get({dict}, {key} [, {def}]) any get item {key} from {dict} or {def}
@@ -4550,6 +4551,21 @@ foreground() Move the Vim window to the foreground. Useful when sent from
|remote_foreground()| instead.
{only in the Win32 GUI and console version}
+fullcommand({name}) *fullcommand()*
+ Get the full command name from a short abbreviated command
+ name; see |20.2| for details on command abbreviations.
+
+ {name} may start with a `:` and can include a [range], these
+ are skipped and not returned.
+ Returns an empty string if a command doesn't exist or if it's
+ ambiguous (for user-defined functions).
+
+ For example `fullcommand('s')`, `fullcommand('sub')`,
+ `fullcommand(':%substitute')` all return "substitute".
+
+ Can also be used as a |method|: >
+ GetName()->fullcommand()
+<
*funcref()*
funcref({name} [, {arglist}] [, {dict}])
Just like |function()|, but the returned Funcref will lookup
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 6a9284dac9..7e611a47f3 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -852,6 +852,7 @@ Command line: *command-line-functions*
getcmdtype() return the current command-line type
getcmdwintype() return the current command-line window type
getcompletion() list of command-line completion matches
+ fullcommand() get full command name
Quickfix and location lists: *quickfix-functions*
getqflist() list of quickfix errors