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 #7777)
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 8bab492..0773b24 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2562,6 +2562,7 @@
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}
function({name} [, {arglist}] [, {dict}])
@@ -4902,6 +4903,21 @@
{only in the Win32, Athena, Motif and GTK GUI versions and the
Win32 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