diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/vim9.txt | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index b6feebf84..b66109780 100644 --- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -942,9 +942,22 @@ Ex command ranges need to be prefixed with a colon. > Some Ex commands can be confused with assignments in Vim9 script: > g:name = value # assignment - g:pattern:cmd # invalid command - ERROR :g:pattern:cmd # :global command +To avoid confusion between a `:global` or `:substitute` command and an +expression or assignment, a few separators cannot be used when these commands +are abbreviated to a single character: ':', '-' and '.'. > + g:pattern:cmd # invalid command - ERROR + s:pattern:repl # invalid command - ERROR + g-pattern-cmd # invalid command - ERROR + s-pattern-repl # invalid command - ERROR + g.pattern.cmd # invalid command - ERROR + s.pattern.repl # invalid command - ERROR + +Also, there cannot be a space between the command and the separator: > + g /pattern/cmd # invalid command - ERROR + s /pattern/repl # invalid command - ERROR + Functions defined with `:def` compile the whole function. Legacy functions can bail out, and the following lines are not parsed: > func Maybe() |