Last active
December 5, 2015 05:36
-
-
Save waltarix/1407905 to your computer and use it in GitHub Desktop.
zsh: Fix Ambiguous-width CJK treating problem.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Src/compat.c b/Src/compat.c | |
index 9041c0b..4d2b320 100644 | |
--- a/Src/compat.c | |
+++ b/Src/compat.c | |
@@ -860,6 +860,7 @@ int mk_wcswidth(const wchar_t *pwcs, size_t n) | |
return width; | |
} | |
+#endif /* 0 */ | |
/* | |
@@ -951,7 +952,6 @@ int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n) | |
return width; | |
} | |
-#endif /* 0 */ | |
/**/ | |
#endif /* BROKEN_WCWIDTH && (__STDC_ISO_10646__ || __APPLE__) */ | |
diff --git a/Src/zsh.h b/Src/zsh.h | |
index d3bfcef..b021ff4 100644 | |
--- a/Src/zsh.h | |
+++ b/Src/zsh.h | |
@@ -3076,7 +3076,7 @@ typedef wint_t convchar_t; | |
* works on MacOS which doesn't define that. | |
*/ | |
#if defined(BROKEN_WCWIDTH) && (defined(__STDC_ISO_10646__) || defined(__APPLE__)) | |
-#define WCWIDTH(wc) mk_wcwidth(wc) | |
+#define WCWIDTH(wc) mk_wcwidth_cjk(wc) | |
#else | |
#define WCWIDTH(wc) wcwidth(wc) | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FYI: https://github.com/fumiyas/wcwidth-cjk