Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Cannot paste unicode <0221>, <0234> - <024f>



It might be possible to rely *only* on wcwidth() in cases where we're
using a replacement?  Does anyone from the Apple world have any
opinions?

pws

diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index 8391739..d0384af 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -1278,7 +1278,15 @@ zrefresh(void)
 #ifdef __STDC_ISO_10646__
 		 !ZSH_INVALID_WCHAR_TEST(*t) &&
 #endif
-		 iswprint(*t) && (width = WCWIDTH(*t)) > 0) {
+		 /*
+		  * If we are using a replacement wcwidth(), rely
+		  * on it also for checking printability: width <= 0
+		  * if not printable.
+		  */
+#ifndef BROKEN_WCWIDTH
+		 iswprint(*t) &&
+#endif
+		 (width = WCWIDTH(*t)) > 0) {
 	    int ichars;
 	    if (width > rpms.sen - rpms.s) {
 		int started = 0;



Messages sorted by: Reverse Date, Date, Thread, Author