}
else
{
- char_u *p = buf + len;
- int char_len = (*mb_char2bytes)(c, p);
-#ifdef FEAT_GUI
- int save_gui_in_use = gui.in_use;
-
- gui.in_use = FALSE;
-#endif
- // if the character contains CSI or K_SPECIAL bytes they need escaping
- len += fix_input_buffer(p, char_len);
-#ifdef FEAT_GUI
- gui.in_use = save_gui_in_use;
-#endif
+ char_u *end = add_char2buf(c, buf + len);
+ *end = NUL;
+ len = end - buf;
}
(void)ins_typebuf(buf, KeyNoremap, 0, !KeyTyped, cmd_silent);
return len;
p += 2;
i -= 2;
}
- // When the GUI is not used CSI needs to be escaped.
+# ifndef MSWIN
+ // When not on MS-Windows and the GUI is not used CSI needs to be
+ // escaped.
else if (!gui.in_use && p[0] == CSI)
{
mch_memmove(p + 3, p + 1, (size_t)i);
*p = (int)KE_CSI;
len += 2;
}
+# endif
else
#endif
if (p[0] == NUL || (p[0] == K_SPECIAL