0
0
mirror of https://github.com/vim/vim.git synced 2025-10-05 05:34:07 -04:00

patch 8.2.2785: Vim9: cannot redirect to local variable

Problem:    Vim9: cannot redirect to local variable.
Solution:   Compile :redir when redirecting to a variable.
This commit is contained in:
Bram Moolenaar
2021-04-19 20:50:03 +02:00
parent 4c13721482
commit 2d1c57ed3d
9 changed files with 335 additions and 97 deletions

View File

@@ -1194,5 +1194,23 @@ def Test_substitute_expr()
bwipe!
enddef
def Test_redir_to_var()
var result: string
redir => result
echo 'something'
redir END
assert_equal("\nsomething", result)
redir =>> result
echo 'more'
redir END
assert_equal("\nsomething\nmore", result)
var lines =<< trim END
redir => notexist
END
CheckDefFailure(lines, 'E1089:')
enddef
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker