Patch 8.2.2811

7 views
Skip to first unread message

Bram Moolenaar

unread,
Apr 25, 2021, 10:36:34 AM4/25/21
to vim...@googlegroups.com

Patch 8.2.2811
Problem: Vim9: error for missing white space doesn't say where it is
missing
Solution: Mention the command. (closes #8149)
Files: src/ex_docmd.c, src/errors.h, src/testdir/test_vim9_cmd.vim


*** ../vim-8.2.2810/src/ex_docmd.c 2021-04-24 20:36:59.848978076 +0200
--- src/ex_docmd.c 2021-04-25 16:30:01.450904803 +0200
***************
*** 3673,3680 ****
&& (eap->cmdidx < 0 ||
(cmdnames[eap->cmdidx].cmd_argt & EX_NONWHITE_OK) == 0))
{
! semsg(_(e_command_not_followed_by_white_space_str), eap->cmd);
eap->cmdidx = CMD_SIZE;
}
#endif

--- 3673,3683 ----
&& (eap->cmdidx < 0 ||
(cmdnames[eap->cmdidx].cmd_argt & EX_NONWHITE_OK) == 0))
{
! char_u *cmd = vim_strnsave(eap->cmd, p - eap->cmd);
!
! semsg(_(e_command_str_not_followed_by_white_space_str), cmd, eap->cmd);
eap->cmdidx = CMD_SIZE;
+ vim_free(cmd);
}
#endif

*** ../vim-8.2.2810/src/errors.h 2021-04-19 20:49:58.156857538 +0200
--- src/errors.h 2021-04-25 16:30:26.930811717 +0200
***************
*** 323,330 ****
INIT(= N_("E1142: Non-empty string required"));
EXTERN char e_empty_expression_str[]
INIT(= N_("E1143: Empty expression: \"%s\""));
! EXTERN char e_command_not_followed_by_white_space_str[]
! INIT(= N_("E1144: Command is not followed by white space: %s"));
EXTERN char e_missing_heredoc_end_marker_str[]
INIT(= N_("E1145: Missing heredoc end marker: %s"));
EXTERN char e_command_not_recognized_str[]
--- 323,330 ----
INIT(= N_("E1142: Non-empty string required"));
EXTERN char e_empty_expression_str[]
INIT(= N_("E1143: Empty expression: \"%s\""));
! EXTERN char e_command_str_not_followed_by_white_space_str[]
! INIT(= N_("E1144: Command \"%s\" is not followed by white space: %s"));
EXTERN char e_missing_heredoc_end_marker_str[]
INIT(= N_("E1145: Missing heredoc end marker: %s"));
EXTERN char e_command_not_recognized_str[]
*** ../vim-8.2.2810/src/testdir/test_vim9_cmd.vim 2021-04-25 14:48:45.500794221 +0200
--- src/testdir/test_vim9_cmd.vim 2021-04-25 16:34:22.661950212 +0200
***************
*** 984,1001 ****
command -nargs=1 Comd echom <q-args>

var lines =<< trim END
! vim9script
! Comd # comment
END
CheckScriptSuccess(lines)

lines =<< trim END
! vim9script
! Comd# comment
END
CheckScriptFailure(lines, 'E1144:')
-
delcommand Comd
enddef

def Test_star_command()
--- 984,1009 ----
command -nargs=1 Comd echom <q-args>

var lines =<< trim END
! vim9script
! Comd # comment
END
CheckScriptSuccess(lines)

lines =<< trim END
! vim9script
! Comd# comment
END
CheckScriptFailure(lines, 'E1144:')
delcommand Comd
+
+ lines =<< trim END
+ vim9script
+ command Foo echo 'Foo'
+ Foo3Bar
+ END
+ CheckScriptFailure(lines, 'E1144: Command "Foo" is not followed by white space: Foo3Bar')
+
+ delcommand Foo
enddef

def Test_star_command()
*** ../vim-8.2.2810/src/version.c 2021-04-25 14:48:45.500794221 +0200
--- src/version.c 2021-04-25 16:35:35.569683300 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2811,
/**/

--
hundred-and-one symptoms of being an internet addict:
171. You invent another person and chat with yourself in empty chat rooms.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages