patch 8.2.3307: Vim9: :echoconsole cannot access local variables
Problem: Vim9: :echoconsole cannot access local variables.
Solution: Handle like other :echo commands. (closes #8708)
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim
index 93dce83..2c5e3e7 100644
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -2493,10 +2493,11 @@
enddef
def Test_echoerr_cmd()
+ var local = 'local'
try
- echoerr 'something' 'wrong' # comment
+ echoerr 'something' local 'wrong' # comment
catch
- assert_match('something wrong', v:exception)
+ assert_match('something local wrong', v:exception)
endtry
enddef
@@ -2515,6 +2516,12 @@
CheckScriptSuccess(lines)
enddef
+def Test_echoconsole_cmd()
+ var local = 'local'
+ echoconsole 'something' local # comment
+ # output goes anywhere
+enddef
+
def Test_for_outside_of_function()
var lines =<< trim END
vim9script