diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-09-01 16:00:53 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-01 16:00:53 +0100 |
commit | 7d7ad7b2e8c6403033fbdb083f092321c0ccbfaf (patch) | |
tree | 4dc8f66a97862870b7d09ac390e75f0912b046e1 /src/testdir | |
parent | be807d582499acbe314ead3891481cba6ca136df (diff) |
patch 9.0.0350: :echowindow does not work in a compiled functionv9.0.0350
Problem: :echowindow does not work in a compiled function.
Solution: Handle the expression at compile time.
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_vim9_disassemble.vim | 11 | ||||
-rw-r--r-- | src/testdir/test_vim9_script.vim | 7 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/testdir/test_vim9_disassemble.vim b/src/testdir/test_vim9_disassemble.vim index be40088d3b..12be156483 100644 --- a/src/testdir/test_vim9_disassemble.vim +++ b/src/testdir/test_vim9_disassemble.vim @@ -2274,6 +2274,8 @@ def s:Echomsg() echomsg 'some' 'message' echoconsole 'nothing' echoerr 'went' .. 'wrong' + var local = 'window' + echowin 'in' local enddef def Test_disassemble_echomsg() @@ -2289,7 +2291,14 @@ def Test_disassemble_echomsg() "echoerr 'went' .. 'wrong'\\_s*" .. '\d PUSHS "wentwrong"\_s*' .. '\d ECHOERR 1\_s*' .. - '\d RETURN void', + "var local = 'window'\\_s*" .. + '\d\+ PUSHS "window"\_s*' .. + '\d\+ STORE $0\_s*' .. + "echowin 'in' local\\_s*" .. + '\d\+ PUSHS "in"\_s*' .. + '\d\+ LOAD $0\_s*' .. + '\d\+ ECHOWINDOW 2\_s*' .. + '\d\+ RETURN void', res) enddef diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index 5aec8ffc86..bdefc8756a 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -2011,6 +2011,13 @@ def Test_echoconsole_cmd() # output goes anywhere enddef +def Test_echowindow_cmd() + var local = 'local' + echowindow 'something' local # comment + # output goes in message window + popup_clear() +enddef + def Test_for_outside_of_function() var lines =<< trim END vim9script |