Mercurial > vim
comparison src/testdir/test_vim9_cmd.vim @ 24222:a2e6029d354e v8.2.2652
patch 8.2.2652: Vim9: can use command modifier without an effect
Commit: https://github.com/vim/vim/commit/fa984418e7becd8e7d6543cd3ea25f605e9ac97f
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 25 22:15:28 2021 +0100
patch 8.2.2652: Vim9: can use command modifier without an effect
Problem: Vim9: can use command modifier without an effect.
Solution: Give an error for a misplaced command modifier. Fix error message
number.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 25 Mar 2021 22:30:04 +0100 |
parents | 77cb22562852 |
children | d0e86f1b34e7 |
comparison
equal
deleted
inserted
replaced
24221:70ef6b343eee | 24222:a2e6029d354e |
---|---|
795 new | 795 new |
796 silent! :/pat/put _ | 796 silent! :/pat/put _ |
797 bwipe! | 797 bwipe! |
798 enddef | 798 enddef |
799 | 799 |
800 def Test_useless_command_modifier() | |
801 g:maybe = true | |
802 var lines =<< trim END | |
803 if g:maybe | |
804 silent endif | |
805 END | |
806 CheckDefAndScriptFailure(lines, 'E1176:', 2) | |
807 | |
808 lines =<< trim END | |
809 for i in [0] | |
810 silent endfor | |
811 END | |
812 CheckDefAndScriptFailure(lines, 'E1176:', 2) | |
813 | |
814 lines =<< trim END | |
815 while g:maybe | |
816 silent endwhile | |
817 END | |
818 CheckDefAndScriptFailure(lines, 'E1176:', 2) | |
819 | |
820 lines =<< trim END | |
821 silent try | |
822 finally | |
823 endtry | |
824 END | |
825 CheckDefAndScriptFailure(lines, 'E1176:', 1) | |
826 | |
827 lines =<< trim END | |
828 try | |
829 silent catch | |
830 endtry | |
831 END | |
832 CheckDefAndScriptFailure(lines, 'E1176:', 2) | |
833 | |
834 lines =<< trim END | |
835 try | |
836 silent finally | |
837 endtry | |
838 END | |
839 CheckDefAndScriptFailure(lines, 'E1176:', 2) | |
840 | |
841 lines =<< trim END | |
842 try | |
843 finally | |
844 silent endtry | |
845 END | |
846 CheckDefAndScriptFailure(lines, 'E1176:', 3) | |
847 enddef | |
848 | |
800 def Test_eval_command() | 849 def Test_eval_command() |
801 var from = 3 | 850 var from = 3 |
802 var to = 5 | 851 var to = 5 |
803 g:val = 111 | 852 g:val = 111 |
804 def Increment(nrs: list<number>) | 853 def Increment(nrs: list<number>) |