1
0
forked from aniani/vim

patch 8.2.0341: using ":for" in Vim9 script gives an error

Problem:    Using ":for" in Vim9 script gives an error.
Solution:   Pass the LET_NO_COMMAND flag. (closes #5715)
This commit is contained in:
Bram Moolenaar
2020-03-01 16:22:40 +01:00
parent 087d2e1518
commit 41fe061753
3 changed files with 20 additions and 2 deletions

View File

@@ -775,5 +775,19 @@ def Test_echo_cmd()
assert_match('^some more$', Screenline(&lines))
enddef
def Test_for_outside_of_function()
let lines =<< trim END
vim9script
new
for var in range(0, 3)
append(line('$'), var)
endfor
assert_equal(['', '0', '1', '2', '3'], getline(1, '$'))
bwipe!
END
writefile(lines, 'Xvim9for.vim')
source Xvim9for.vim
delete('Xvim9for.vim')
enddef
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker