Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: menu-select without ZLS_COLOURS
- X-seq: zsh-workers 6902
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: menu-select without ZLS_COLOURS
- Date: Tue, 29 Jun 1999 08:58:34 +0200 (MET DST)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
This patch makes menu-selection use the codes for `%S' and `%s' as a
default if ZLS_COLO(|U)RS is not set.
Hm, should we do this if ZLS_* is set but does not define `ma', too?
But the other defaults for it are vt100'ish anyway...
Bye
Sven
diff -u os/Zle/complist.c Src/Zle/complist.c
--- os/Zle/complist.c Mon Jun 28 16:18:36 1999
+++ Src/Zle/complist.c Mon Jun 28 22:33:51 1999
@@ -198,7 +198,7 @@
/* This initializes the given terminal color structure. */
-static int
+static void
getcols(Listcols c)
{
char *s;
@@ -206,16 +206,17 @@
if (!(s = getsparam("ZLS_COLORS")) &&
!(s = getsparam("ZLS_COLOURS"))) {
- if (!c)
- return 1;
for (i = 0; i < NUM_COLS; i++)
c->cols[i] = "";
-
c->exts = NULL;
- return 1;
+
+ if (!(c->cols[COL_MA] = tcstr[TCSTANDOUTBEG]) ||
+ !c->cols[COL_MA][0])
+ c->cols[COL_MA] = "";
+ else
+ c->cols[COL_EC] = tcstr[TCSTANDOUTEND];
+ return;
}
- if (!c)
- return 0;
/* We have one of the parameters, use it. */
memset(c, 0, sizeof(*c));
s = dupstring(s);
@@ -230,7 +231,7 @@
if (!c->cols[COL_MI])
c->cols[COL_MI] = c->cols[COL_FI];
- return 0;
+ return;
}
static int last_col = COL_NO;
@@ -651,8 +652,8 @@
int i = 0;
char *s;
- if (getcols(NULL) || (dummy && (!(s = getsparam("SELECTMIN")) ||
- (dat && dat->num < atoi(s)))))
+ if (dummy && (!(s = getsparam("SELECTMIN")) ||
+ (dat && dat->num < atoi(s))))
return 1;
selectlocalmap(mskeymap);
diff -u od/Zsh/mod_complist.yo Doc/Zsh/mod_complist.yo
--- od/Zsh/mod_complist.yo Mon Jun 28 16:18:48 1999
+++ Doc/Zsh/mod_complist.yo Mon Jun 28 22:32:02 1999
@@ -92,7 +92,9 @@
list. In the list one match is highlighted using the value for tt(ma)
from the tt(ZLS_COLORS) or tt(ZLS_COLOURS) parameter. The default
value for this it `tt(7)' which forces the selected match to be
-highlighted using standout mode on a vt100 compatible terminal.
+highlighted using standout mode on a vt100 compatible terminal. If
+neither tt(ZLS_COLORS) nor tt(ZLS_COLOURS) is set, the same terminal
+control sequence is used as for the `tt(%S)' escape in prompts.
Selecting matches is done by moving the mark around using the zle movement
functions. The zle functions tt(send-break) and tt(accept-line) can be used
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author