Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mattn/46405 to your computer and use it in GitHub Desktop.
Save mattn/46405 to your computer and use it in GitHub Desktop.
Index: src/term.c
===================================================================
--- src/term.c (revision 1318)
+++ src/term.c (working copy)
@@ -5152,7 +5152,7 @@
#ifdef FEAT_MBYTE
/* skip multibyte char correctly */
- for (i = (*mb_ptr2len)(src); i > 0; --i)
+ if ((i = (*mb_ptr2len)(src)) == 1)
#endif
{
/*
@@ -5177,7 +5177,13 @@
else
result[dlen++] = *src;
++src;
+#ifdef FEAT_MBYTE
+ } else {
+ mch_memmove(result + dlen, src, i);
+ dlen += i;
+ src += i;
}
+#endif
}
result[dlen] = NUL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment