0
0
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:
Bram Moolenaar
2006-04-29 21:55:22 +00:00
parent 8ea9123258
commit d8fc5c0b99
8 changed files with 930 additions and 225 deletions

View File

@@ -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