summaryrefslogtreecommitdiff
path: root/Src/Zle/compresult.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-07-18 13:10:07 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-07-18 13:10:07 +0000
commit8c1b953b5a6c49d47f55d311d16852f94d2ebeed (patch)
treebbd14925f61c99b3aa89067b89e82abbae4f253e /Src/Zle/compresult.c
parent40f651019666eba2c3c8a53055f16d28f6ed9385 (diff)
downloadzsh-8c1b953b5a6c49d47f55d311d16852f94d2ebeed.tar.gz
zsh-8c1b953b5a6c49d47f55d311d16852f94d2ebeed.zip
add list-grouped option to make options and such be grouped together if they have the same description; matches with line-display strings can be hidden; hi and du capabalities in complist are only used if set by the user (15407)
Diffstat (limited to 'Src/Zle/compresult.c')
-rw-r--r--Src/Zle/compresult.c71
1 files changed, 37 insertions, 34 deletions
diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c
index c1da0fbff..0e7bbedba 100644
--- a/Src/Zle/compresult.c
+++ b/Src/Zle/compresult.c
@@ -1443,44 +1443,46 @@ calclist(int showall)
}
m->flags &= ~CMF_HIDE;
- if (m->disp) {
- if (m->flags & CMF_DISPLINE) {
- nlines += 1 + printfmt(m->disp, 0, 0, 0);
- g->flags |= CGF_HASDL;
- } else {
- l = niceztrlen(m->disp);
- ndisp++;
- if (l > glong)
- glong = l;
- if (l < gshort)
- gshort = l;
- totl += l;
- mlens[m->gnum] = l;
- }
- nlist++;
- if (!(m->flags & CMF_PACKED))
- g->flags &= ~CGF_PACKED;
- if (!(m->flags & CMF_ROWS))
- g->flags &= ~CGF_ROWS;
- } else if (showall || !(m->flags & (CMF_NOLIST | CMF_MULT))) {
+ if (showall || !(m->flags & (CMF_NOLIST | CMF_MULT))) {
if ((m->flags & (CMF_NOLIST | CMF_MULT)) &&
(!m->str || !*m->str)) {
m->flags |= CMF_HIDE;
continue;
}
- l = niceztrlen(m->str);
- ndisp++;
- if (l > glong)
- glong = l;
- if (l < gshort)
- gshort = l;
- totl += l;
- mlens[m->gnum] = l;
- nlist++;
- if (!(m->flags & CMF_PACKED))
- g->flags &= ~CGF_PACKED;
- if (!(m->flags & CMF_ROWS))
- g->flags &= ~CGF_ROWS;
+ if (m->disp) {
+ if (m->flags & CMF_DISPLINE) {
+ nlines += 1 + printfmt(m->disp, 0, 0, 0);
+ g->flags |= CGF_HASDL;
+ } else {
+ l = niceztrlen(m->disp);
+ ndisp++;
+ if (l > glong)
+ glong = l;
+ if (l < gshort)
+ gshort = l;
+ totl += l;
+ mlens[m->gnum] = l;
+ }
+ nlist++;
+ if (!(m->flags & CMF_PACKED))
+ g->flags &= ~CGF_PACKED;
+ if (!(m->flags & CMF_ROWS))
+ g->flags &= ~CGF_ROWS;
+ } else {
+ l = niceztrlen(m->str);
+ ndisp++;
+ if (l > glong)
+ glong = l;
+ if (l < gshort)
+ gshort = l;
+ totl += l;
+ mlens[m->gnum] = l;
+ nlist++;
+ if (!(m->flags & CMF_PACKED))
+ g->flags &= ~CGF_PACKED;
+ if (!(m->flags & CMF_ROWS))
+ g->flags &= ~CGF_ROWS;
+ }
} else
hidden = 1;
}
@@ -1972,7 +1974,8 @@ printlist(int over, CLPrintFunc printm, int showall)
if (g->flags & CGF_HASDL) {
for (p = g->matches; (m = *p); p++)
- if (m->disp && (m->flags & CMF_DISPLINE)) {
+ if (m->disp && (m->flags & CMF_DISPLINE) &&
+ (showall || !(m->flags & (CMF_HIDE|CMF_NOLIST)))) {
if (pnl) {
putc('\n', shout);
pnl = 0;