1
0
forked from aniani/vim

patch 8.2.1042: Vim9: cannot put an operator on the next line

Problem:    Vim9: cannot put an operator on the next line.
Solution:   Require a colon before a range to see if that causes problems.
This commit is contained in:
Bram Moolenaar
2020-06-22 23:02:51 +02:00
parent 7eaafe65ee
commit df069eec3b
7 changed files with 59 additions and 25 deletions

View File

@@ -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 ~