summaryrefslogtreecommitdiff
path: root/Src/Zle/complist.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/complist.c')
-rw-r--r--Src/Zle/complist.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index bcf356179..5e5ba9f20 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -383,12 +383,25 @@ getcoldef(char *s)
} else if (*s == '=') {
char *p = ++s, *t, *cols[MAX_POS];
int ncols = 0;
+ int nesting = 0;
Patprog prog;
/* This is for a pattern. */
- while (*s && *s != '=')
- s++;
+ while (*s && (nesting || *s != '=')) {
+ switch (*s++) {
+ case '\\':
+ if (*s)
+ s++;
+ break;
+ case '(':
+ nesting++;
+ break;
+ case ')':
+ nesting--;
+ break;
+ }
+ }
if (!*s)
return s;
*s++ = '\0';
@@ -2500,7 +2513,7 @@ domenuselect(Hookdef dummy, Chdata dat)
mlbeg--;
}
}
- if ((space = zterm_lines - pl - mhasstat))
+ if ((space = zterm_lines - pl - mhasstat) > 0)
while (mline >= mlbeg + space)
if ((mlbeg += step) + space > mlines)
mlbeg = mlines - space;