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

Re: UTF-8/unicode/widechar refresh bug



On Sat, 22 Dec 2007 06:03:57 +0100
"Mikael Magnusson" <mikachu@xxxxxxxxx> wrote:
> bindkey '^E' reset-prompt #or whatever key you want
> : aaaaa(enter some characters so the cursor just wraps)〜aaaaaaaa<ctrl-e>
> 
> at this point everything after the character that probably gets
> garbled in the mail disappears.

This seems to fix the problem.

Index: Src/Zle/zle_refresh.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_refresh.c,v
retrieving revision 1.50
diff -u -r1.50 zle_refresh.c
--- Src/Zle/zle_refresh.c	23 Nov 2007 00:19:23 -0000	1.50
+++ Src/Zle/zle_refresh.c	5 Jan 2008 13:09:51 -0000
@@ -1055,6 +1055,18 @@
 	ccs = lpromptw;
     }
 
+#ifdef MULTIBYTE_SUPPORT
+    /*
+     * Realign to a real character after any jiggery pokery at
+     * the start of the line.
+     */
+    while (*nl == WEOF) {
+	nl++, ccs++, vcs++;
+	if (*ol)
+	    ol++;
+    }
+#endif
+
 /* 3: main display loop - write out the buffer using whatever tricks we can */
 
     for (;;) {

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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