Skip to content

Instantly share code, notes, and snippets.

@mattn
Created June 6, 2014 13:52
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/6f66c3f8186369cabd90 to your computer and use it in GitHub Desktop.
Save mattn/6f66c3f8186369cabd90 to your computer and use it in GitHub Desktop.
diff -r bed71c37618c src/getchar.c
--- a/src/getchar.c Thu May 29 14:36:29 2014 +0200
+++ b/src/getchar.c Fri Jun 06 22:51:58 2014 +0900
@@ -1699,7 +1699,7 @@
c = CSI;
#endif
}
-#ifdef MSDOS
+#if defined(MSDOS) || (defined(WIN3264) && !defined(FEAT_GUI))
/*
* If K_NUL was typed, it is replaced by K_NUL, 3 in mch_inchar().
* Delete the 3 here.
diff -r bed71c37618c src/os_win32.c
--- a/src/os_win32.c Thu May 29 14:36:29 2014 +0200
+++ b/src/os_win32.c Fri Jun 06 22:51:58 2014 +0900
@@ -1805,6 +1805,21 @@
n + unconverted, TYPEAHEADLEN - typeaheadlen,
rest == NULL ? &rest : NULL, &restlen);
}
+
+ /* Convert K_NUL in input characters. */
+ {
+ char_u *p = typeahead + typeaheadlen;
+ char_u *e = typeahead + TYPEAHEADLEN;
+ while (*p && p < e) {
+ if (*p == K_NUL) {
+ p++;
+ mch_memmove(p, p + 1, 1);
+ *p = 3;
+ n++;
+ }
+ p++;
+ }
+ }
#endif
/* Use the ALT key to set the 8th bit of the character
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment