mirror of
https://github.com/vim/vim.git
synced 2025-07-04 23:07:33 -04:00
updated for version 7.3.615
Problem: Completion for a user command does not recognize backslash before a space. Solution: Recognize escaped characters. (Yasuhiro Matsumoto)
This commit is contained in:
parent
0cbba94b7e
commit
848f87633a
@ -3390,12 +3390,23 @@ set_one_cmd_context(xp, buff)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* Find start of last argument (argument just before cursor): */
|
/* Find start of last argument (argument just before cursor): */
|
||||||
p = buff + STRLEN(buff);
|
p = buff;
|
||||||
while (p != arg && *p != ' ' && *p != TAB)
|
|
||||||
p--;
|
|
||||||
if (*p == ' ' || *p == TAB)
|
|
||||||
p++;
|
|
||||||
xp->xp_pattern = p;
|
xp->xp_pattern = p;
|
||||||
|
len = STRLEN(buff);
|
||||||
|
while (*p && p < buff + len)
|
||||||
|
{
|
||||||
|
if (*p == ' ' || *p == TAB)
|
||||||
|
{
|
||||||
|
/* argument starts after a space */
|
||||||
|
xp->xp_pattern = ++p;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (*p == '\\' && *(p + 1) != NUL)
|
||||||
|
++p; /* skip over escaped character */
|
||||||
|
mb_ptr_adv(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ea.argt & XFILE)
|
if (ea.argt & XFILE)
|
||||||
{
|
{
|
||||||
@ -3821,8 +3832,22 @@ set_one_cmd_context(xp, buff)
|
|||||||
if (compl == EXPAND_MAPPINGS)
|
if (compl == EXPAND_MAPPINGS)
|
||||||
return set_context_in_map_cmd(xp, (char_u *)"map",
|
return set_context_in_map_cmd(xp, (char_u *)"map",
|
||||||
arg, forceit, FALSE, FALSE, CMD_map);
|
arg, forceit, FALSE, FALSE, CMD_map);
|
||||||
while ((xp->xp_pattern = vim_strchr(arg, ' ')) != NULL)
|
/* Find start of last argument. */
|
||||||
arg = xp->xp_pattern + 1;
|
p = arg;
|
||||||
|
while (*p)
|
||||||
|
{
|
||||||
|
if (*p == ' ')
|
||||||
|
{
|
||||||
|
/* argument starts after a space */
|
||||||
|
arg = p + 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (*p == '\\' && *(p + 1) != NUL)
|
||||||
|
++p; /* skip over escaped character */
|
||||||
|
mb_ptr_adv(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
xp->xp_pattern = arg;
|
xp->xp_pattern = arg;
|
||||||
}
|
}
|
||||||
xp->xp_context = compl;
|
xp->xp_context = compl;
|
||||||
|
@ -714,6 +714,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 */
|
||||||
|
/**/
|
||||||
|
615,
|
||||||
/**/
|
/**/
|
||||||
614,
|
614,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user