forked from aniani/vim
patch 9.1.1074: Strange error when heredoc marker starts with "trim"
Problem: Strange error when heredoc marker starts with "trim". Solution: Check for whitespace after "trim" or "eval" (zeertzjq) For :python3 etc., a heredoc marker that starts with a lower-case letter is valid, and when it starts with "trim" it works in a script but not in a function, and this PR makes it works in a function. For :let, a heredoc marker that starts with a lower-case letter is not valid, but when it starts with "trim" or "eval" the error can be a bit confusing in a function, and this PR make it less confusing. closes: #16574 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
23da16d3d0
commit
449c2e5454
@@ -435,6 +435,24 @@ func Test_let_heredoc_fails()
|
||||
call assert_report('Caught exception: ' .. v:exception)
|
||||
endtry
|
||||
|
||||
try
|
||||
let v =<< trim trimm
|
||||
trimm
|
||||
call assert_report('No exception thrown')
|
||||
catch /E221:/
|
||||
catch
|
||||
call assert_report('Caught exception: ' .. v:exception)
|
||||
endtry
|
||||
|
||||
try
|
||||
let v =<< trim trim evall
|
||||
evall
|
||||
call assert_report('No exception thrown')
|
||||
catch /E221:/
|
||||
catch
|
||||
call assert_report('Caught exception: ' .. v:exception)
|
||||
endtry
|
||||
|
||||
let text =<< trim END
|
||||
func WrongSyntax()
|
||||
let v =<< that there
|
||||
|
||||
Reference in New Issue
Block a user