summaryrefslogtreecommitdiff
path: root/Src/Zle/computil.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/computil.c')
-rw-r--r--Src/Zle/computil.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index 7c5bc2181..cd508d0ac 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -226,8 +226,8 @@ cd_prep()
runp = &(cd_state.runs);
if (cd_state.groups) {
- int lines = cd_state.groups + cd_state.descs;
- VARARR(Cdstr, grps, lines);
+ int preplines = cd_state.groups + cd_state.descs;
+ VARARR(Cdstr, grps, preplines);
VARARR(int, wids, cd_state.maxg);
Cdstr gs, gp, gn, *gpp;
int i, j, d;
@@ -275,7 +275,7 @@ cd_prep()
if (cd_state.gprew > cd_state.maxmlen && cd_state.maxglen > 1)
return 1;
- for (i = 0; i < lines; i++) {
+ for (i = 0; i < preplines; i++) {
Cdstr s = grps[i];
int dummy;
@@ -283,9 +283,9 @@ cd_prep()
unmetafy(s->sortstr, &dummy);
}
- qsort(grps, lines, sizeof(Cdstr), cd_sort);
+ qsort(grps, preplines, sizeof(Cdstr), cd_sort);
- for (i = lines, strp = grps; i > 1; i--, strp++) {
+ for (i = preplines, strp = grps; i > 1; i--, strp++) {
strp2 = strp + 1;
if (!strcmp((*strp)->desc, (*strp2)->desc))
continue;
@@ -303,9 +303,9 @@ cd_prep()
expl = (Cdrun) zalloc(sizeof(*run));
expl->type = CRT_EXPL;
expl->strs = grps[0];
- expl->count = lines;
+ expl->count = preplines;
- for (i = lines, strp = grps, strp2 = NULL; i; i--, strp++) {
+ for (i = preplines, strp = grps, strp2 = NULL; i; i--, strp++) {
str = *strp;
*strp = str->other;
if (strp2)
@@ -321,7 +321,7 @@ cd_prep()
*strp2 = NULL;
for (i = cd_state.maxg - 1; i; i--) {
- for (d = 0, j = lines, strp = grps; j; j--, strp++) {
+ for (d = 0, j = preplines, strp = grps; j; j--, strp++) {
if ((str = *strp)) {
if (d) {
*runp = run = (Cdrun) zalloc(sizeof(*run));
@@ -465,7 +465,7 @@ cd_init(char *nam, char *hide, char *mlen, char *sep,
cd_state.showd = disp;
cd_state.maxg = cd_state.groups = cd_state.descs = 0;
cd_state.maxmlen = atoi(mlen);
- itmp = columns - cd_state.swidth - 4;
+ itmp = zterm_columns - cd_state.swidth - 4;
if (cd_state.maxmlen > itmp)
cd_state.maxmlen = itmp;
if (cd_state.maxmlen < 4)
@@ -545,7 +545,7 @@ cd_init(char *nam, char *hide, char *mlen, char *sep,
args++;
}
if (disp && grp) {
- int mg = columns;
+ int mg = zterm_columns;
do {
cd_group(mg);
@@ -651,7 +651,8 @@ cd_get(char **params)
* is available. Leave 1 character at the end of screen
* as safety margin
*/
- remw = columns - cd_state.premaxw - cd_state.swidth - 3;
+ remw = zterm_columns - cd_state.premaxw -
+ cd_state.swidth - 3;
d = str->desc;
w = MB_METASTRWIDTH(d);
if (w <= remw)
@@ -727,7 +728,8 @@ cd_get(char **params)
case CRT_EXPL:
{
/* add columns as safety margin */
- VARARR(char, dbuf, cd_state.suf + cd_state.slen + columns);
+ VARARR(char, dbuf, cd_state.suf + cd_state.slen +
+ zterm_columns);
char buf[20], *p, *pp, *d;
int i = run->count, remw, w, l;
@@ -743,7 +745,8 @@ cd_get(char **params)
}
strcpy(dbuf, cd_state.sep);
- remw = columns - cd_state.gprew - cd_state.swidth - CM_SPACE;
+ remw = zterm_columns - cd_state.gprew -
+ cd_state.swidth - CM_SPACE;
p = pp = dbuf + cd_state.slen;
d = str->desc;
w = MB_METASTRWIDTH(d);
@@ -1904,7 +1907,7 @@ ca_parse_line(Cadef d, int multi, int first)
state.argbeg = state.optbeg = state.nargbeg = state.restbeg = state.actopts =
state.nth = state.inopt = state.inarg = state.opt = state.arg = 1;
state.argend = argend = arrlen(compwords) - 1;
- state.inrest = state.doff = state.singles = state.doff = state.oopt = 0;
+ state.inrest = state.doff = state.singles = state.oopt = 0;
state.curpos = compcurrent;
state.args = znewlinklist();
state.oargs = (LinkList *) zalloc(d->nopts * sizeof(LinkList));
@@ -3355,7 +3358,6 @@ bin_compvalues(char *nam, char **args, UNUSED(Options ops), UNUSED(int func))
return 0;
}
- return 1;
case 'D':
/* This returns the description and action to use if we are at