1
0
forked from aniani/vim

patch 8.2.4934: string interpolation fails when not evaluating

Problem:    String interpolation fails when not evaluating.
Solution:   Skip the expression when not evaluating. (closes #10398)
This commit is contained in:
Bram Moolenaar
2022-05-10 18:11:43 +01:00
parent df6e0e46c5
commit 70c41241c2
5 changed files with 24 additions and 11 deletions

View File

@@ -2156,6 +2156,13 @@ def Test_expr8_string()
->split($'x{x}x')
->map((_, v: string) => v =~ 'bar')
assert_equal([false, true, false], vl)
# interpolated string in a lambda
lines =<< trim END
assert_equal(['gnome-256color', 'xterm-256color'], ['gnome', 'xterm']
->map((_, term: string) => $'{term}-256color'))
END
v9.CheckDefAndScriptSuccess(lines)
enddef
def Test_expr8_vimvar()