To: vim_dev@googlegroups.com Subject: Patch 8.2.1943 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1943 Problem: Vim9: wrong error message when colon is missing. Solution: Check for a missing colon. (issue #7239) Files: src/ex_docmd.c, src/testdir/test_vim9_cmd.vim *** ../vim-8.2.1942/src/ex_docmd.c 2020-11-01 17:03:34.211513814 +0100 --- src/ex_docmd.c 2020-11-02 21:01:16.348137965 +0100 *************** *** 1807,1818 **** if (ea.cmd == cmd + 1 && *cmd == '$') // should be "$VAR = val" --ea.cmd; ! else if (ea.cmd > cmd) { ! emsg(_(e_colon_required_before_a_range)); ! goto doend; } - p = find_ex_command(&ea, NULL, lookup_scriptvar, NULL); } else #endif --- 1807,1825 ---- if (ea.cmd == cmd + 1 && *cmd == '$') // should be "$VAR = val" --ea.cmd; ! p = find_ex_command(&ea, NULL, lookup_scriptvar, NULL); ! if (ea.cmdidx == CMD_SIZE) { ! char_u *ar = skip_range(ea.cmd, TRUE, NULL); ! ! // If a ':' before the range is missing, give a clearer error ! // message. ! if (ar > ea.cmd) ! { ! emsg(_(e_colon_required_before_a_range)); ! goto doend; ! } } } else #endif *** ../vim-8.2.1942/src/testdir/test_vim9_cmd.vim 2020-11-01 22:15:41.694350182 +0100 --- src/testdir/test_vim9_cmd.vim 2020-11-02 21:06:18.982857753 +0100 *************** *** 460,465 **** --- 460,474 ---- # verbose enddef + def Test_range_after_command_modifier() + CheckScriptFailure(['vim9script', 'silent keepjump 1d _'], 'E1050:', 2) + new + setline(1, 'xxx') + CheckScriptSuccess(['vim9script', 'silent keepjump :1d _']) + assert_equal('', getline(1)) + bwipe! + enddef + def Test_eval_command() var from = 3 var to = 5 *** ../vim-8.2.1942/src/version.c 2020-11-02 20:03:51.619794735 +0100 --- src/version.c 2020-11-02 21:02:52.847713985 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 1943, /**/ -- hundred-and-one symptoms of being an internet addict: 181. You still remember the "happy tune" your modem made while dialing your ISP. /// 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 ///