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

Re: Regression in UTF-8 support



Andrey Borzenkov <arvidjaar@xxxxxxxxxx> wrote:
> this fixed history truncation but not strange mangling in completion
> listing.

There were some bits I missed or got wrong when updating nicechar().

Index: Src/utils.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/utils.c,v
retrieving revision 1.94
diff -u -r1.94 utils.c
--- Src/utils.c	20 Sep 2005 16:33:01 -0000	1.94
+++ Src/utils.c	27 Sep 2005 14:19:45 -0000
@@ -260,7 +260,7 @@
      * This can't happen if the character is printed "nicely", so
      * this results in a maximum of two bytes total (plus the null).
      */
-    if (itok(c)) {
+    if (imeta(c)) {
 	*s++ = Meta;
 	*s++ = c ^ 32;
     } else
Index: Src/Zle/complist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complist.c,v
retrieving revision 1.71
diff -u -r1.71 complist.c
--- Src/Zle/complist.c	10 Aug 2005 13:21:16 -0000	1.71
+++ Src/Zle/complist.c	27 Sep 2005 14:19:45 -0000
@@ -570,11 +570,12 @@
 	    cc = *s++ ^ 32;
 
 	for (t = nicechar(cc); *t; t++) {
+	    int nc = (*t == Meta) ? STOUC(*++t ^ 32) : STOUC(*t);
 	    if (ml == mlend - 1 && col == columns - 1) {
 		mlprinted = ml - oml;
 		return 0;
 	    }
-	    putc(*t, shout);
+	    putc(nc, shout);
 	    if (++col == columns) {
 		ml++;
 		if (mscroll && !--mrestlines && (ask = asklistscroll(ml))) {
@@ -978,11 +979,12 @@
 	    c = *s++ ^ 32;
 
 	for (t = nicechar(c); *t; t++) {
+	    int nc = (*t == Meta) ? STOUC(*++t ^ 32) : STOUC(*t);
 	    if (ml == mlend - 1 && col == columns - 1) {
 		mlprinted = ml - oml;
 		return 0;
 	    }
-	    putc(*t, shout);
+	    putc(nc, shout);
 	    if (++col == columns) {
 		ml++;
 		if (mscroll && !--mrestlines && (ask = asklistscroll(ml))) {


-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************



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