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

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

Probably worth checking if BROKEN_WCWIDTH is already defined in config.h
and if not what happens if you define it.  It has no effect unless
one of __STDC_ISO_10646__ or __APPLE__ is also defined.

An other option is --enable-unicode9, but you'll need the appropriate
header and library support for that to work.

You might want to confirm also if it actually is wcwidth() rather than
iswprint() by hacking zle_refresh.c e.g. the following (untested).  This
might be a plausible patch, actually --- if iswprint() succeeds,
presumably the printing width actually is positive (combining characters
are handled as a special case afterwards).


diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index 8391739..835eed7 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -1278,8 +1278,11 @@ zrefresh(void)
 #ifdef __STDC_ISO_10646__
-		 iswprint(*t) && (width = WCWIDTH(*t)) > 0) {
+		 iswprint(*t)) {
 	    int ichars;
+	    width = WCWIDTH(*t);
+	    if (width <= 0)
+		width = 1;
 	    if (width > rpms.sen - rpms.s) {
 		int started = 0;

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