Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG]select command display in wrong
- X-seq: zsh-workers 53292
 
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
 
- To: safreya <safreya@xxxxxx>
 
- Cc: zsh-workers@xxxxxxx
 
- Subject: Re: [BUG]select command display in wrong
 
- Date: Fri, 27 Dec 2024 14:58:18 -0800
 
- Archived-at: <https://zsh.org/workers/53292>
 
- In-reply-to: <CAH+w=7ZUTNSLJ74tZv4sy7=YYisrZK7xtwgU_7kkMCFsVioiBQ@mail.gmail.com>
 
- List-id: <zsh-workers.zsh.org>
 
- References: <tencent_63654B61CCD0966D73F5A25824618A84D505@qq.com> <CAH+w=7ZUTNSLJ74tZv4sy7=YYisrZK7xtwgU_7kkMCFsVioiBQ@mail.gmail.com>
 
On Fri, Dec 27, 2024 at 2:46 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> This seems pretty straightforward.
After a second look, this is somewhat better; it may still get the
columnation wrong if the visual length is different than the string
length.
diff --git a/Src/loop.c b/Src/loop.c
index 84dc66476..dbb923ace 100644
--- a/Src/loop.c
+++ b/Src/loop.c
@@ -351,9 +351,12 @@ selectlist(LinkList l, size_t start)
 
     zleentry(ZLE_CMD_TRASH);
     arr = hlinklist2array(l, 0);
-    for (ap = arr; *ap; ap++)
-	if (strlen(*ap) > longest)
-	    longest = strlen(*ap);
+    for (ap = arr; *ap; ap++) {
+	int aplen = 0;
+	(void) unmetafy(*ap, &aplen);
+	if (aplen > longest)
+	    longest = aplen;
+    }
     t0 = ct = ap - arr;
     longest++;
     while (t0)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author