Skip to content

Instantly share code, notes, and snippets.

@mattn
Created December 18, 2014 01:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattn/783f0df279cadd04500e to your computer and use it in GitHub Desktop.
Save mattn/783f0df279cadd04500e to your computer and use it in GitHub Desktop.
diff -r fee313e21905 src/os_win32.c
--- a/src/os_win32.c Wed Dec 10 14:54:50 2014 +0900
+++ b/src/os_win32.c Thu Dec 18 10:02:49 2014 +0900
@@ -1814,18 +1814,20 @@
if (conv)
{
char_u *p = typeahead + typeaheadlen;
- char_u *e = typeahead + TYPEAHEADLEN;
-
- while (*p && p < e)
+ if (*p != K_NUL)
{
- if (*p == K_NUL)
+ char_u *e = typeahead + TYPEAHEADLEN;
+ while (*p && p < e)
{
+ if (*p == K_NUL)
+ {
+ ++p;
+ mch_memmove(p + 1, p, ((size_t)(e - p)) - 1);
+ *p = 3;
+ ++n;
+ }
++p;
- mch_memmove(p + 1, p, ((size_t)(e - p)) - 1);
- *p = 3;
- ++n;
}
- ++p;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment