diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-08-10 19:53:01 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-08-10 19:53:01 +0200 |
commit | 917c46abe559f3d779ad87500e874376111ca1ef (patch) | |
tree | dfb91ceb975b8a2282937900b74172f4260637ee /src/testdir/test_vim9_cmd.vim | |
parent | b6f55bb5b4d7d03cdf47d552db20d06e41354d5f (diff) | |
download | vim-git-917c46abe559f3d779ad87500e874376111ca1ef.tar.gz |
patch 8.2.3324: Vim9: Cannot use :silent with :endwhilev8.2.3324
Problem: Vim9: Cannot use :silent with :endwhile.
Solution: Allow for using the :silent modifier. (closes #8737)
Diffstat (limited to 'src/testdir/test_vim9_cmd.vim')
-rw-r--r-- | src/testdir/test_vim9_cmd.vim | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim index a6241134a..84cb6d665 100644 --- a/src/testdir/test_vim9_cmd.vim +++ b/src/testdir/test_vim9_cmd.vim @@ -807,6 +807,17 @@ def Test_modifier_silent_unsilent() echomsg "caught" endtry assert_equal("\ncaught", execute(':1messages')) + + var lines =<< trim END + vim9script + set history=11 + silent! while 0 + set history=22 + silent! endwhile + assert_equal(11, &history) + set history& + END + CheckScriptSuccess(lines) enddef def Test_range_after_command_modifier() @@ -836,13 +847,16 @@ def Test_useless_command_modifier() for i in [0] silent endfor END - CheckDefAndScriptFailure(lines, 'E1176:', 2) + CheckDefFailure(lines, 'E1176:', 2) + CheckScriptSuccess(['vim9script'] + lines) lines =<< trim END while g:maybe silent endwhile END - CheckDefAndScriptFailure(lines, 'E1176:', 2) + CheckDefFailure(lines, 'E1176:', 2) + g:maybe = false + CheckScriptSuccess(['vim9script'] + lines) lines =<< trim END silent try |