diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2023-12-16 14:36:08 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-12-16 14:36:08 +0100 |
commit | a185a31fc05c2dd15315cd59afc02b69aabb5893 (patch) | |
tree | 8ea80a62b1ca0270e484c1fd102cf9a2954cebe9 /src/testdir/test_vim9_script.vim | |
parent | 535e8f59410a4d3065829e010bc5e13608a968cc (diff) |
patch 9.0.2172: Vim9: compiling :defer may failv9.0.2172
Problem: Vim9: compiling :defer may fail
Solution: compile defer, when ctx_skip is not SKIP_YES
compiling defer fails in an if statement with false condition,
so check the ctx_skip value when compiling :defer
fixes: #13698
closes: #13702
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/testdir/test_vim9_script.vim')
-rw-r--r-- | src/testdir/test_vim9_script.vim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index b64f05e89d..2aca20ad8d 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -4783,6 +4783,19 @@ def Test_multidefer_with_exception() v9.CheckSourceSuccess(lines) enddef +" Test for using ":defer" inside an if statement with a false condition +def Test_defer_skipped() + var lines =<< trim END + def Foo() + if false + defer execute('echow "hello"', "") + endif + enddef + defcompile + END + v9.CheckSourceSuccess(lines) +enddef + " Keep this last, it messes up highlighting. def Test_substitute_cmd() new |