summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2002-02-07 08:40:01 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2002-02-07 08:40:01 +0000
commit9e0f74f07b3cb95cc6aacc413b1ac1373c5fcf9a (patch)
tree02048f0013eac3ae5e08f5b3026c2b06a8fe7abd
parent0eefb1ec2566bc1d3a6e341820ea1d139530d753 (diff)
downloadzsh-9e0f74f07b3cb95cc6aacc413b1ac1373c5fcf9a.tar.gz
zsh-9e0f74f07b3cb95cc6aacc413b1ac1373c5fcf9a.tar.xz
zsh-9e0f74f07b3cb95cc6aacc413b1ac1373c5fcf9a.zip
fix for displaying matches in groups via _describe; go back to displaying one match per line when lines get too long (16582)
-rw-r--r--ChangeLog6
-rw-r--r--Src/Zle/computil.c11
2 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 46ec99313..74ef69eb8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-02-07  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 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  <clint@zsh.org>
 
 	* 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