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:
@@ -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
|
||||
|
Reference in New Issue
Block a user