mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-23 17:01:05 +02:00
fix for longer capability strings (sunsite still not responding, sigh)
This commit is contained in:
parent
65b3fdc4ab
commit
a2417f6863
2 changed files with 14 additions and 7 deletions
|
@ -1,10 +1,15 @@
|
||||||
|
2000-06-13 Sven Wischnowsky <wischnow@zsh.org>
|
||||||
|
|
||||||
|
* ?????: Src/Zle/complist.c: fix for longer capability strings;
|
||||||
|
very bad
|
||||||
|
|
||||||
2000-06-13 Peter Stephenson <pws@cambridgesiliconradio.com>
|
2000-06-13 Peter Stephenson <pws@cambridgesiliconradio.com>
|
||||||
|
|
||||||
* TBA: Src/zsh.h: make PRINT_ flags unique again.
|
* TBA: Src/zsh.h: make PRINT_ flags unique again.
|
||||||
|
|
||||||
2000-06-13 Sven Wischnowsky <wischnow@zsh.org>
|
2000-06-13 Sven Wischnowsky <wischnow@zsh.org>
|
||||||
|
|
||||||
* ?????: Completion/Core/_path_files, Src/Zle/complete.c,
|
* 11870: Completion/Core/_path_files, Src/Zle/complete.c,
|
||||||
Src/Zle/compmatch.c, Src/Zle/computil.c: fixes for calling
|
Src/Zle/compmatch.c, Src/Zle/computil.c: fixes for calling
|
||||||
compfiles, for completing words with special characters; make
|
compfiles, for completing words with special characters; make
|
||||||
compfiles optimisations work with globcomplete and simple match
|
compfiles optimisations work with globcomplete and simple match
|
||||||
|
|
|
@ -122,13 +122,17 @@ struct listcols {
|
||||||
Extcol exts; /* strings for extensions */
|
Extcol exts; /* strings for extensions */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Combined length of LC and RC, maximum length of capability strings. */
|
||||||
|
|
||||||
|
static int lr_caplen, max_caplen;
|
||||||
|
|
||||||
/* This parses the value of a definition (the part after the `=').
|
/* This parses the value of a definition (the part after the `=').
|
||||||
* The return value is a pointer to the character after it. */
|
* The return value is a pointer to the character after it. */
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
getcolval(char *s, int multi)
|
getcolval(char *s, int multi)
|
||||||
{
|
{
|
||||||
char *p;
|
char *p, *o = s;
|
||||||
|
|
||||||
for (p = s; *s && *s != ':' && (!multi || *s != '='); p++, s++) {
|
for (p = s; *s && *s != ':' && (!multi || *s != '='); p++, s++) {
|
||||||
if (*s == '\\' && s[1]) {
|
if (*s == '\\' && s[1]) {
|
||||||
|
@ -172,6 +176,8 @@ getcolval(char *s, int multi)
|
||||||
}
|
}
|
||||||
if (p != s)
|
if (p != s)
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
if ((s - o) > max_caplen)
|
||||||
|
max_caplen = s - o;
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,10 +331,6 @@ filecol(char *col)
|
||||||
return fc;
|
return fc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Combined length of LC and RC, maximum length of capability strings. */
|
|
||||||
|
|
||||||
static int lr_caplen, max_caplen;
|
|
||||||
|
|
||||||
/* This initializes the given terminal color structure. */
|
/* This initializes the given terminal color structure. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -337,6 +339,7 @@ getcols(Listcols c)
|
||||||
char *s;
|
char *s;
|
||||||
int i, l;
|
int i, l;
|
||||||
|
|
||||||
|
max_caplen = lr_caplen = 0;
|
||||||
if (!(s = getsparam("ZLS_COLORS")) &&
|
if (!(s = getsparam("ZLS_COLORS")) &&
|
||||||
!(s = getsparam("ZLS_COLOURS"))) {
|
!(s = getsparam("ZLS_COLOURS"))) {
|
||||||
for (i = 0; i < NUM_COLS; i++)
|
for (i = 0; i < NUM_COLS; i++)
|
||||||
|
@ -362,7 +365,6 @@ getcols(Listcols c)
|
||||||
s = getcoldef(c, s);
|
s = getcoldef(c, s);
|
||||||
|
|
||||||
/* Use default values for those that aren't set explicitly. */
|
/* Use default values for those that aren't set explicitly. */
|
||||||
max_caplen = lr_caplen = 0;
|
|
||||||
for (i = 0; i < NUM_COLS; i++) {
|
for (i = 0; i < NUM_COLS; i++) {
|
||||||
if (!c->files[i] || !c->files[i]->col)
|
if (!c->files[i] || !c->files[i]->col)
|
||||||
c->files[i] = filecol(defcols[i]);
|
c->files[i] = filecol(defcols[i]);
|
||||||
|
|
Loading…
Reference in a new issue