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

Re: PATCH: displaying wide characters



On Mon, 24 Oct 2005 10:40:42 +0200
Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> Found one issue with editing wide characters on the command line,
> input some doublewidth characters, erase one near the left end, then
> go to the right and erase another. The second time the cursor will
> only move one character to the left instead of two and cursor display
> will not correspond with reality anymore. For some reason it only
> seems to happen with 6 characters or more, the ones i'm using are
> hiragana.

I think the following patch fixes this issue, at least what I was
seeing.  I'm quite sure there are plenty of other oddities like this.
I also think that, while you can now type a line of double-width
characters that wraps without the display going, there are likely to be
problems when you edit the part of the line before the wrap.

Index: Src/Zle/zle_refresh.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_refresh.c,v
retrieving revision 1.33
diff -u -r1.33 zle_refresh.c
--- Src/Zle/zle_refresh.c	24 Oct 2005 16:58:43 -0000	1.33
+++ Src/Zle/zle_refresh.c	25 Oct 2005 23:09:09 -0000
@@ -1138,6 +1138,12 @@
 			tc_delchars(i);
 			ol += i;
 			char_ins -= i;
+#ifdef ZLE_UNICODE_SUPPORT
+			while (*ol == WEOF) {
+			    ol++;
+			    char_ins--;
+			}
+#endif
 			i = 0;
 			break;
 		    }



-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page still at http://www.pwstephenson.fsnet.co.uk/



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