mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-02 10:01:11 +02:00
53294: fix multibyte handling in "select" prompts
This commit is contained in:
parent
3f43a2ffd1
commit
263659acb7
2 changed files with 19 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2025-01-03 Bart Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
|
* 53294: Src/loop.c: fix multibyte handling in "select" prompts
|
||||||
|
|
||||||
2025-01-03 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
|
2025-01-03 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
|
||||||
|
|
||||||
* 53293: Doc/Zsh/compsys.yo, Doc/Zsh/index.yo, Doc/Zsh/manual.yo:
|
* 53293: Doc/Zsh/compsys.yo, Doc/Zsh/index.yo, Doc/Zsh/manual.yo:
|
||||||
|
|
18
Src/loop.c
18
Src/loop.c
|
@ -351,9 +351,16 @@ selectlist(LinkList l, size_t start)
|
||||||
|
|
||||||
zleentry(ZLE_CMD_TRASH);
|
zleentry(ZLE_CMD_TRASH);
|
||||||
arr = hlinklist2array(l, 0);
|
arr = hlinklist2array(l, 0);
|
||||||
for (ap = arr; *ap; ap++)
|
for (ap = arr; *ap; ap++) {
|
||||||
if (strlen(*ap) > longest)
|
#ifdef MB_METASTRWIDTH
|
||||||
longest = strlen(*ap);
|
int aplen = MB_METASTRWIDTH(*ap);
|
||||||
|
#else
|
||||||
|
int aplen = 0;
|
||||||
|
(void) unmetafy(*ap, &aplen);
|
||||||
|
#endif
|
||||||
|
if (aplen > longest)
|
||||||
|
longest = aplen;
|
||||||
|
}
|
||||||
t0 = ct = ap - arr;
|
t0 = ct = ap - arr;
|
||||||
longest++;
|
longest++;
|
||||||
while (t0)
|
while (t0)
|
||||||
|
@ -368,7 +375,12 @@ selectlist(LinkList l, size_t start)
|
||||||
for (t1 = start; t1 != colsz && t1 - start < zterm_lines - 2; t1++) {
|
for (t1 = start; t1 != colsz && t1 - start < zterm_lines - 2; t1++) {
|
||||||
ap = arr + t1;
|
ap = arr + t1;
|
||||||
do {
|
do {
|
||||||
|
#ifdef MB_METASTRWIDTH
|
||||||
|
size_t t2 = MB_METASTRWIDTH(*ap) + 2;
|
||||||
|
(void) unmetafy(*ap, NULL);
|
||||||
|
#else
|
||||||
size_t t2 = strlen(*ap) + 2;
|
size_t t2 = strlen(*ap) + 2;
|
||||||
|
#endif
|
||||||
int t3;
|
int t3;
|
||||||
|
|
||||||
fprintf(stderr, "%d) %s", t3 = ap - arr + 1, *ap);
|
fprintf(stderr, "%d) %s", t3 = ap - arr + 1, *ap);
|
||||||
|
|
Loading…
Reference in a new issue