From 9e0f74f07b3cb95cc6aacc413b1ac1373c5fcf9a Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Thu, 7 Feb 2002 08:40:01 +0000 Subject: fix for displaying matches in groups via _describe; go back to displaying one match per line when lines get too long (16582) --- ChangeLog | 6 ++++++ Src/Zle/computil.c | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 46ec99313..74ef69eb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-02-07 Sven Wischnowsky + + * 16582: Src/Zle/computil.c: fix for displaying matches in + groups via _describe; go back to displaying one match per line + when lines get too long + 2002-02-07 Clint Adams * unposted: Functions/Prompts/.distfiles, diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index 58115f537..ae94bdf57 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -121,7 +121,7 @@ cd_group() { Cdset set1, set2; Cdstr str1, str2, *strp; - int num; + int num, len; for (set1 = cd_state.sets; set1; set1 = set1->next) { for (str1 = set1->strs; str1; str1 = str1->next) { @@ -129,6 +129,7 @@ cd_group() continue; num = 1; + len = str1->len; strp = &(str1->other); for (set2 = set1; set2; set2 = set2->next) @@ -138,10 +139,18 @@ cd_group() str1->kind = 1; str2->kind = 2; num++; + len += str2->len; *strp = str2; strp = &(str2->other); } *strp = NULL; + len += num * 2 + cd_state.slen; + + if (len >= columns) { + cd_state.groups = 0; + + return; + } if (num > 1) cd_state.groups++; else -- cgit 1.4.1