patch 8.2.4365: sticky command modifiers are too sticky
Problem: sticky command modifiers are too sticky.
Solution: Do not apply command modifiers to a called function. (closes #9751)
diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim
index e7cdcc3..8325d7a 100644
--- a/src/testdir/test_vim9_cmd.vim
+++ b/src/testdir/test_vim9_cmd.vim
@@ -118,6 +118,20 @@
END
v9.CheckScriptSuccess(lines)
delete('Xvim9import.vim')
+
+ # "legacy" does not aply to a called function
+ lines =<< trim END
+ vim9script
+
+ def g:TheFunc()
+ if exists('something')
+ echo 'yes'
+ endif
+ enddef
+ legacy exe 'call g:TheFunc()'
+ END
+ v9.CheckScriptSuccess(lines)
+ delfunc g:TheFunc
enddef
def Test_edit_wildcards()