mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
updated for version 7.0f05
This commit is contained in:
@@ -1032,6 +1032,38 @@ ins_typebuf(str, noremap, offset, nottyped, silent)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Put character "c" back into the typeahead buffer.
|
||||
* Can be used for a character obtained by vgetc() that needs to be put back.
|
||||
*/
|
||||
void
|
||||
ins_char_typebuf(c)
|
||||
int c;
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
char_u buf[MB_MAXBYTES];
|
||||
#else
|
||||
char_u buf[4];
|
||||
#endif
|
||||
if (IS_SPECIAL(c))
|
||||
{
|
||||
buf[0] = K_SPECIAL;
|
||||
buf[1] = K_SECOND(c);
|
||||
buf[2] = K_THIRD(c);
|
||||
buf[3] = NUL;
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
buf[(*mb_char2bytes)(c, buf)] = NUL;
|
||||
#else
|
||||
buf[0] = c;
|
||||
buf[1] = NUL;
|
||||
#endif
|
||||
}
|
||||
(void)ins_typebuf(buf, REMAP_YES, 0, !KeyTyped, FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if the typeahead buffer was changed (while waiting for a
|
||||
* character to arrive). Happens when a message was received from a client or
|
||||
|
Reference in New Issue
Block a user