Mercurial > vim
diff runtime/doc/builtin.txt @ 30275:121d28008c14 v9.0.0473
patch 9.0.0473: fullcommand() only works for the current script version
Commit: https://github.com/vim/vim/commit/aa5341477c9f3840d63f709de3b9e5d0266f93d7
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 15 21:46:02 2022 +0100
patch 9.0.0473: fullcommand() only works for the current script version
Problem: fullcommand() only works for the current script version.
Solution: Add an optional argument for the script version.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 15 Sep 2022 23:00:05 +0200 |
parents | b6b803ed4a53 |
children | 029c59bf78f1 |
line wrap: on
line diff
--- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -195,7 +195,7 @@ foldlevel({lnum}) Number fold level at 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} +fullcommand({name} [, {vim9}]) String get full command from {name} funcref({name} [, {arglist}] [, {dict}]) Funcref reference to function {name} function({name} [, {arglist}] [, {dict}]) @@ -2967,14 +2967,20 @@ foreground() Move the Vim window to the {only in the Win32, Motif and GTK GUI versions and the Win32 console version} -fullcommand({name}) *fullcommand()* +fullcommand({name} [, {vim9}]) *fullcommand()* Get the full command name from a short abbreviated command name; see |20.2| for details on command abbreviations. The string argument {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 commands). + Returns an empty string if a command doesn't exist, if it's + ambiguous (for user-defined commands) or cannot be shortened + this way. |vim9-no-shorten| + + Without the {vim9} argument uses the current script version. + If {vim9} is present and FALSE then legacy script rules are + used. When {vim9} is present and TRUE then Vim9 rules are + used, e.g. "en" is not a short form of "endif". For example `fullcommand('s')`, `fullcommand('sub')`, `fullcommand(':%substitute')` all return "substitute".