mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.3405: cannot have a comment line in a {} block of a user command
Problem: Cannot have a comment line in a {} block of a user command. Solution: Continue after the line break. (closes #8837)
This commit is contained in:
parent
01dd6c3732
commit
ec1b0968aa
@ -2807,7 +2807,16 @@ parse_command_modifiers(
|
|||||||
|
|
||||||
// ignore comment and empty lines
|
// ignore comment and empty lines
|
||||||
if (comment_start(eap->cmd, starts_with_colon))
|
if (comment_start(eap->cmd, starts_with_colon))
|
||||||
|
{
|
||||||
|
// a comment ends at a NL
|
||||||
|
if (eap->nextcmd == NULL)
|
||||||
|
{
|
||||||
|
eap->nextcmd = vim_strchr(eap->cmd, '\n');
|
||||||
|
if (eap->nextcmd != NULL)
|
||||||
|
++eap->nextcmd;
|
||||||
|
}
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
}
|
||||||
if (*eap->cmd == NUL)
|
if (*eap->cmd == NUL)
|
||||||
{
|
{
|
||||||
if (!skip_only)
|
if (!skip_only)
|
||||||
|
@ -624,7 +624,8 @@ endfunc
|
|||||||
|
|
||||||
func Test_usercmd_with_block()
|
func Test_usercmd_with_block()
|
||||||
command DoSomething {
|
command DoSomething {
|
||||||
g:didit = 'yes'
|
g:didit = 'yes' # comment
|
||||||
|
# comment line
|
||||||
g:didmore = 'more'
|
g:didmore = 'more'
|
||||||
}
|
}
|
||||||
DoSomething
|
DoSomething
|
||||||
|
@ -755,6 +755,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
3405,
|
||||||
/**/
|
/**/
|
||||||
3404,
|
3404,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user