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

Re: some unicode issues [was Re: PATCH: fix 4, was Re: unpatch: metafying zle line]



> 한국어            Englishий/         ish中文            Ελληνικά     中文                                  
> català/             español/            Português/          Ελληνικάeek  中文ish                               
> English/             français/           Türkçe/            Русский                       
> 
> The directories with the / suffix are colored red, and the unmarked ones are uncolored.
> Display width is also miscalculated when tabbing through the completions.

This addresses that problem, though I suspect that the string should be
unmetafied elsewhere.  Yes? No?

--- orig/Src/Zle/compcore.c
+++ mod/Src/Zle/compcore.c
@@ -2465,16 +2465,23 @@
     if ((flags & CMF_FILE) && orig[0] && orig[strlen(orig) - 1] != '/') {
         struct stat buf;
         char *pb;
+	int blahl;
 
         pb = (char *) zhalloc((cm->prpre ? strlen(cm->prpre) : 0) +
                               3 + strlen(orig));
         sprintf(pb, "%s%s", (cm->prpre ? cm->prpre : "./"), orig);
 
-        if (!ztat(pb, &buf, 1)) {
+	char *blah = ztrdup(pb);
+
+	unmetafy(blah, &blahl);
+
+        if (!ztat(blah, &buf, 1)) {
             cm->mode = buf.st_mode;
             if ((cm->modec = file_type(buf.st_mode)) == ' ')
                 cm->modec = '\0';
         }
+
+	free(blah);
     }
     if ((*compqstack == '\\' && compqstack[1]) ||
 	(autoq && *compqstack && compqstack[1] == '\\'))



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