Patch 8.2.2216
Problem: Vim9: range with missing colon can be hard to spot.
Solution: Include the start of the range in the error. (closes #7543)
Files: src/errors.h, src/ex_docmd.c, src/vim9compile.c,
src/testdir/test_vim9_cmd.vim
*** ../vim-8.2.2215/src/errors.h 2020-12-24 21:56:37.643479575 +0100
--- src/errors.h 2020-12-25 19:11:22.117836777 +0100
***************
*** 133,140 ****
INIT(= N_("E1048: Item not found in script: %s"));
EXTERN char e_item_not_exported_in_script_str[]
INIT(= N_("E1049: Item not exported in script: %s"));
! EXTERN char e_colon_required_before_a_range[]
! INIT(= N_("E1050: Colon required before a range"));
EXTERN char e_wrong_argument_type_for_plus[]
INIT(= N_("E1051: Wrong argument type for +"));
EXTERN char e_cannot_declare_an_option[]
--- 133,140 ----
INIT(= N_("E1048: Item not found in script: %s"));
EXTERN char e_item_not_exported_in_script_str[]
INIT(= N_("E1049: Item not exported in script: %s"));
! EXTERN char e_colon_required_before_range_str[]
! INIT(= N_("E1050: Colon required before a range: %s"));
EXTERN char e_wrong_argument_type_for_plus[]
INIT(= N_("E1051: Wrong argument type for +"));
EXTERN char e_cannot_declare_an_option[]
*** ../vim-8.2.2215/src/ex_docmd.c 2020-12-25 17:36:23.710969861 +0100
--- src/ex_docmd.c 2020-12-25 19:18:27.536540808 +0100
***************
*** 1839,1845 ****
// message.
if (ar > ea.cmd)
{
! emsg(_(e_colon_required_before_a_range));
goto doend;
}
}
--- 1839,1845 ----
// message.
if (ar > ea.cmd)
{
! semsg(_(e_colon_required_before_range_str), ea.cmd);
goto doend;
}
}
*** ../vim-8.2.2215/src/vim9compile.c 2020-12-25 18:35:24.384193544 +0100
--- src/vim9compile.c 2020-12-25 19:11:55.929734351 +0100
***************
*** 7727,7733 ****
{
if (!starts_with_colon)
{
! emsg(_(e_colon_required_before_a_range));
goto erret;
}
if (ends_excmd2(line, ea.cmd))
--- 7727,7733 ----
{
if (!starts_with_colon)
{
! semsg(_(e_colon_required_before_range_str), cmd);
goto erret;
}
if (ends_excmd2(line, ea.cmd))
*** ../vim-8.2.2215/src/testdir/test_vim9_cmd.vim 2020-12-25
18:35:24.388193533 +0100
--- src/testdir/test_vim9_cmd.vim 2020-12-25 19:22:58.555569869 +0100
***************
*** 549,555 ****
enddef
def Test_range_after_command_modifier()
! CheckScriptFailure(['vim9script', 'silent keepjump 1d _'], 'E1050:', 2)
new
setline(1, 'xxx')
CheckScriptSuccess(['vim9script', 'silent keepjump :1d _'])
--- 549,555 ----
enddef
def Test_range_after_command_modifier()
! CheckScriptFailure(['vim9script', 'silent keepjump 1d _'], 'E1050: Colon
required before a range: 1d _', 2)
new
setline(1, 'xxx')
CheckScriptSuccess(['vim9script', 'silent keepjump :1d _'])
*** ../vim-8.2.2215/src/version.c 2020-12-25 18:35:24.388193533 +0100
--- src/version.c 2020-12-25 19:10:37.605971417 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2216,
/**/
--
How To Keep A Healthy Level Of Insanity:
11. Specify that your drive-through order is "to go".
/// Bram Moolenaar -- [email protected] -- 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 ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202012251826.0BPIQKiG3610584%40masaka.moolenaar.net.