forked from aniani/vim
updated for version 7.2.346
Problem: Repeating a command with @: causes a mapping to be applied twice. Solution: Do not remap characters inserted in the typeahead buffer. (Kana Natsuno)
This commit is contained in:
15
src/ops.c
15
src/ops.c
@@ -1301,10 +1301,16 @@ put_reedit_in_typebuf(silent)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Insert register contents "s" into the typeahead buffer, so that it will be
|
||||||
|
* executed again.
|
||||||
|
* When "esc" is TRUE it is to be taken literally: Escape CSI characters and
|
||||||
|
* no remapping.
|
||||||
|
*/
|
||||||
static int
|
static int
|
||||||
put_in_typebuf(s, esc, colon, silent)
|
put_in_typebuf(s, esc, colon, silent)
|
||||||
char_u *s;
|
char_u *s;
|
||||||
int esc; /* Escape CSI characters */
|
int esc;
|
||||||
int colon; /* add ':' before the line */
|
int colon; /* add ':' before the line */
|
||||||
int silent;
|
int silent;
|
||||||
{
|
{
|
||||||
@@ -1312,7 +1318,7 @@ put_in_typebuf(s, esc, colon, silent)
|
|||||||
|
|
||||||
put_reedit_in_typebuf(silent);
|
put_reedit_in_typebuf(silent);
|
||||||
if (colon)
|
if (colon)
|
||||||
retval = ins_typebuf((char_u *)"\n", REMAP_YES, 0, TRUE, silent);
|
retval = ins_typebuf((char_u *)"\n", REMAP_NONE, 0, TRUE, silent);
|
||||||
if (retval == OK)
|
if (retval == OK)
|
||||||
{
|
{
|
||||||
char_u *p;
|
char_u *p;
|
||||||
@@ -1324,12 +1330,13 @@ put_in_typebuf(s, esc, colon, silent)
|
|||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
retval = FAIL;
|
retval = FAIL;
|
||||||
else
|
else
|
||||||
retval = ins_typebuf(p, REMAP_YES, 0, TRUE, silent);
|
retval = ins_typebuf(p, esc ? REMAP_NONE : REMAP_YES,
|
||||||
|
0, TRUE, silent);
|
||||||
if (esc)
|
if (esc)
|
||||||
vim_free(p);
|
vim_free(p);
|
||||||
}
|
}
|
||||||
if (colon && retval == OK)
|
if (colon && retval == OK)
|
||||||
retval = ins_typebuf((char_u *)":", REMAP_YES, 0, TRUE, silent);
|
retval = ins_typebuf((char_u *)":", REMAP_NONE, 0, TRUE, silent);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -681,6 +681,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 */
|
||||||
|
/**/
|
||||||
|
346,
|
||||||
/**/
|
/**/
|
||||||
345,
|
345,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user