diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-06-22 23:02:51 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-06-22 23:02:51 +0200 |
commit | df069eec3b90401e880e9b0e258146d8f36c474d (patch) | |
tree | 9c61c092a5982318a5f7ee92f51b553621b019f5 /runtime | |
parent | 7eaafe65eef88493c789b160914c8e2e8e42d4a7 (diff) | |
download | vim-git-df069eec3b90401e880e9b0e258146d8f36c474d.tar.gz |
patch 8.2.1042: Vim9: cannot put an operator on the next linev8.2.1042
Problem: Vim9: cannot put an operator on the next line.
Solution: Require a colon before a range to see if that causes problems.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/vim9.txt | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index 9a40959e5..21bc542a1 100644 --- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -1,4 +1,4 @@ -*vim9.txt* For Vim version 8.2. Last change: 2020 Jun 21 +*vim9.txt* For Vim version 8.2. Last change: 2020 Jun 22 VIM REFERENCE MANUAL by Bram Moolenaar @@ -257,27 +257,32 @@ Function call: > arg2 ) -For binary operators iin expressions not in [], {} or () a line break is -possible AFTER the operators. For example: > - let text = lead .. - middle .. - end +For binary operators in expressions not in [], {} or () a line break is +possible just before or after the operator. For example: > + let text = lead + .. middle + .. end let total = start + end - correction - let result = positive ? - PosFunc(arg) : - NegFunc(arg) + let result = positive + ? PosFunc(arg) + : NegFunc(arg) -A special case is "->" for function call chains, it can appear in the next -line: > let result = GetBuilder() ->BuilderSetWidth(333) ->BuilderSetHeight(777) ->BuilderBuild() -Note that "enddef" cannot be used at the start of a continuation line, it ends -the current function. +< *E1050* +To make it possible for the operator at the start of the line to be +recognized, it is required to put a colon before a range. This will adde +"start" and print: > + let result = start + + print +This will assign "start" and print a line: > + let result = start + :+ print It is also possible to split a function header over multiple lines, in between arguments: > @@ -286,6 +291,9 @@ arguments: > separator = '-' ): string +Note that "enddef" cannot be used at the start of a continuation line, it ends +the current function. + No curly braces expansion ~ |