0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.2.3645: Vim9: The "no effect" error is not given for all registers

Problem:    Vim9: The "no effect" error is not given for all registers.
Solution:   Include any character following '@'. (closes #8779)
This commit is contained in:
Bram Moolenaar
2021-11-22 15:05:46 +00:00
parent 2228cd72cf
commit 7d5b8becc3
3 changed files with 47 additions and 8 deletions

View File

@@ -887,22 +887,32 @@ report_discard_pending(int pending, void *value)
}
}
/*
* Return TRUE if "arg" is only a variable, register or option name.
*/
int
cmd_is_name_only(char_u *arg)
{
char_u *p = arg;
char_u *alias;
char_u *alias = NULL;
int name_only = FALSE;
if (*p == '&')
if (*p == '@')
{
++p;
if (STRNCMP("l:", p, 2) == 0 || STRNCMP("g:", p, 2) == 0)
p += 2;
if (*p != NUL)
++p;
}
else
{
if (*p == '&')
{
++p;
if (STRNCMP("l:", p, 2) == 0 || STRNCMP("g:", p, 2) == 0)
p += 2;
}
get_name_len(&p, &alias, FALSE, FALSE);
}
else if (*p == '@')
++p;
get_name_len(&p, &alias, FALSE, FALSE);
name_only = ends_excmd2(arg, skipwhite(p));
vim_free(alias);
return name_only;