1
0
forked from aniani/vim

patch 9.0.1164: evaluating string expression advances function line

Problem:    Evaluating string expression advances function line.
Solution:   Disable function lines while parsing a string expression.
            (Hirohito Higashi, closes #11796)
This commit is contained in:
h-east
2023-01-09 15:10:40 +00:00
committed by Bram Moolenaar
parent dda3053121
commit 01c5f2addf
3 changed files with 21 additions and 0 deletions

View File

@@ -3700,6 +3700,17 @@ def Test_expr9_method_call_linebreak()
assert_equal('', v:errmsg)
END
v9.CheckScriptSuccess(lines)
# this was skipping over the expression without an error
lines =<< trim END
vim9script
def Test(s: string): string
return substitute(s, 'A', '\=toupper("x")', 'g')
->tolower()
enddef
assert_equal('xbcd', Test('ABCD'))
END
v9.CheckScriptSuccess(lines)
enddef
def Test_expr9_method_call_import()