To: vim_dev@googlegroups.com Subject: Patch 8.2.2214 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2214 Problem: ":e#" does not give a warning for missing white space. Solution: Adjust the check for white space. (closes #7545) Files: src/ex_docmd.c, src/testdir/test_vim9_script.vim *** ../vim-8.2.2213/src/ex_docmd.c 2020-12-21 19:59:04.569197722 +0100 --- src/ex_docmd.c 2020-12-25 17:19:59.622472606 +0100 *************** *** 3532,3538 **** #ifdef FEAT_EVAL if (eap->cmdidx != CMD_SIZE && in_vim9script() ! && !IS_WHITE_OR_NUL(*p) && !ends_excmd(*p) && *p != '!' && (cmdnames[eap->cmdidx].cmd_argt & EX_NONWHITE_OK) == 0) { semsg(_(e_command_not_followed_by_white_space_str), eap->cmd); --- 3532,3538 ---- #ifdef FEAT_EVAL if (eap->cmdidx != CMD_SIZE && in_vim9script() ! && !IS_WHITE_OR_NUL(*p) && *p != '\n' && *p != '!' && (cmdnames[eap->cmdidx].cmd_argt & EX_NONWHITE_OK) == 0) { semsg(_(e_command_not_followed_by_white_space_str), eap->cmd); *** ../vim-8.2.2213/src/testdir/test_vim9_script.vim 2020-12-24 21:56:37.647479568 +0100 --- src/testdir/test_vim9_script.vim 2020-12-25 17:28:05.804717153 +0100 *************** *** 2132,2138 **** CheckScriptFailure([ 'vim9script', 'echo# something', ! ], 'E121:') CheckScriptFailure([ 'echo "yes" # something', ], 'E121:') --- 2132,2138 ---- CheckScriptFailure([ 'vim9script', 'echo# something', ! ], 'E1144:') CheckScriptFailure([ 'echo "yes" # something', ], 'E121:') *************** *** 2152,2158 **** CheckScriptFailure([ 'vim9script', 'exe# something', ! ], 'E121:') CheckScriptFailure([ 'exe "echo" # something', ], 'E121:') --- 2152,2158 ---- CheckScriptFailure([ 'vim9script', 'exe# something', ! ], 'E1144:') CheckScriptFailure([ 'exe "echo" # something', ], 'E121:') *************** *** 2162,2179 **** ' echo "yes"', 'catch', 'endtry', ! ], 'E488:') CheckScriptFailure([ 'vim9script', 'try# comment', 'echo "yes"', ! ], 'E488:') CheckDefFailure([ 'try', ' throw#comment', 'catch', 'endtry', ! ], 'E1143:') CheckDefFailure([ 'try', ' throw "yes"#comment', --- 2162,2179 ---- ' echo "yes"', 'catch', 'endtry', ! ], 'E1144:') CheckScriptFailure([ 'vim9script', 'try# comment', 'echo "yes"', ! ], 'E1144:') CheckDefFailure([ 'try', ' throw#comment', 'catch', 'endtry', ! ], 'E1144:') CheckDefFailure([ 'try', ' throw "yes"#comment', *************** *** 2185,2198 **** ' echo "yes"', 'catch# comment', 'endtry', ! ], 'E488:') CheckScriptFailure([ 'vim9script', 'try', ' echo "yes"', 'catch# comment', 'endtry', ! ], 'E654:') CheckDefFailure([ 'try', ' echo "yes"', --- 2185,2198 ---- ' echo "yes"', 'catch# comment', 'endtry', ! ], 'E1144:') CheckScriptFailure([ 'vim9script', 'try', ' echo "yes"', 'catch# comment', 'endtry', ! ], 'E1144:') CheckDefFailure([ 'try', ' echo "yes"', *************** *** 2204,2217 **** 'echo "yes"', 'catch', 'endtry# comment', ! ], 'E488:') CheckScriptFailure([ 'vim9script', 'try', ' echo "yes"', 'catch', 'endtry# comment', ! ], 'E488:') CheckScriptSuccess([ 'vim9script', --- 2204,2217 ---- 'echo "yes"', 'catch', 'endtry# comment', ! ], 'E1144:') CheckScriptFailure([ 'vim9script', 'try', ' echo "yes"', 'catch', 'endtry# comment', ! ], 'E1144:') CheckScriptSuccess([ 'vim9script', *************** *** 2220,2226 **** CheckScriptFailure([ 'vim9script', 'hi# comment', ! ], 'E416:') CheckScriptSuccess([ 'vim9script', 'hi Search # comment', --- 2220,2226 ---- CheckScriptFailure([ 'vim9script', 'hi# comment', ! ], 'E1144:') CheckScriptSuccess([ 'vim9script', 'hi Search # comment', *************** *** 2266,2272 **** CheckScriptFailure([ 'vim9script', 'match# comment', ! ], 'E475:') CheckScriptSuccess([ 'vim9script', 'match none # comment', --- 2266,2272 ---- CheckScriptFailure([ 'vim9script', 'match# comment', ! ], 'E1144:') CheckScriptSuccess([ 'vim9script', 'match none # comment', *************** *** 2402,2408 **** 'vim9script', 'command Echo echo# comment', 'Echo', ! ], 'E121:') delcommand Echo var curdir = getcwd() --- 2402,2408 ---- 'vim9script', 'command Echo echo# comment', 'Echo', ! ], 'E1144:') delcommand Echo var curdir = getcwd() *************** *** 2447,2453 **** CheckScriptFailure([ 'vim9script', 'function# comment', ! ], 'E129:') CheckScriptSuccess([ 'vim9script', 'function CheckScriptSuccess # comment', --- 2447,2453 ---- CheckScriptFailure([ 'vim9script', 'function# comment', ! ], 'E1144:') CheckScriptSuccess([ 'vim9script', 'function CheckScriptSuccess # comment', *************** *** 2516,2522 **** CheckScriptFailure([ 'vim9script', 'gui#comment' ! ], 'E499:') CheckScriptFailure([ 'vim9script', 'gui -f#comment' --- 2516,2522 ---- CheckScriptFailure([ 'vim9script', 'gui#comment' ! ], 'E1144:') CheckScriptFailure([ 'vim9script', 'gui -f#comment' *************** *** 3124,3129 **** --- 3124,3134 ---- exit_cb: Func}) END CheckDefAndScriptFailure(lines, 'E1144:', 1) + + lines =<< trim END + e# + END + CheckDefAndScriptFailure(lines, 'E1144:', 1) enddef def Test_script_var_gone_when_sourced_twice() *** ../vim-8.2.2213/src/version.c 2020-12-25 16:11:50.096319934 +0100 --- src/version.c 2020-12-25 17:29:26.476431768 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2214, /**/ -- How To Keep A Healthy Level Of Insanity: 9. As often as possible, skip rather than walk. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///