1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-31 06:00:54 +01:00

manual/8333

This commit is contained in:
Tanaka Akira 1999-10-19 14:50:40 +00:00
parent 30b4434af8
commit 2e12135906
3 changed files with 754 additions and 335 deletions

View file

@ -197,6 +197,8 @@ struct cmgroup {
LinkList lfmatches; /* list of matches without fignore */
LinkList lallccs; /* list of used compctls */
int num; /* number of this group */
int nbrbeg; /* number of opened braces */
int nbrend; /* number of closed braces */
/* The following is collected/used during listing. */
int dcount; /* number of matches to list in columns */
int cols; /* number of columns */
@ -229,8 +231,8 @@ struct cmatch {
char *disp; /* string to display (compadd -d) */
char autoq; /* closing quote to add automatically */
int flags; /* see CMF_* below */
int brpl; /* the place where to put the brace prefix */
int brsl; /* ...and the suffix */
int *brpl; /* places where to put the brace prefixes */
int *brsl; /* ...and the suffixes */
char *rems; /* when to remove the suffix */
char *remf; /* shell function to call for suffix-removal */
int qipl; /* length of quote-prefix */
@ -356,6 +358,19 @@ struct cldata {
typedef void (*CLPrintFunc)(Cmgroup, Cmatch *, int, int, int, int,
char *, struct stat *);
/* Information about one brace run. */
typedef struct brinfo *Brinfo;
struct brinfo {
Brinfo next; /* next in list */
Brinfo prev; /* previous (only for closing braces) */
char *str; /* the string to insert */
int pos; /* original position */
int qpos; /* original position, with quoting */
int curpos; /* position for current match */
};
/* Data given to hooks. */
typedef struct chdata *Chdata;

View file

@ -523,8 +523,9 @@ typedef struct menustack *Menustack;
struct menustack {
Menustack prev;
char *line;
char *brbeg;
char *brend;
Brinfo brbeg;
Brinfo brend;
int nbrbeg, nbrend;
int cs, acc, nmatches;
struct menuinfo info;
Cmgroup amatches, pmatches, lastmatches, lastlmatches;
@ -605,8 +606,10 @@ domenuselect(Hookdef dummy, Chdata dat)
s->lastmatches = lastmatches;
s->lastlmatches = lastlmatches;
s->acc = menuacc;
s->brbeg = dupstring(brbeg);
s->brend = dupstring(brend);
s->brbeg = dupbrinfo(brbeg, NULL);
s->brend = dupbrinfo(brend, NULL);
s->nbrbeg = nbrbeg;
s->nbrend = nbrend;
s->nmatches = nmatches;
menucmp = menuacc = 0;
fixsuffix();
@ -638,8 +641,10 @@ domenuselect(Hookdef dummy, Chdata dat)
s->amatches = s->pmatches =
s->lastmatches = s->lastlmatches = NULL;
s->acc = menuacc;
s->brbeg = dupstring(brbeg);
s->brend = dupstring(brend);
s->brbeg = dupbrinfo(brbeg, NULL);
s->brend = dupbrinfo(brend, NULL);
s->nbrbeg = nbrbeg;
s->nbrend = nbrend;
s->nmatches = nmatches;
acceptlast();
do_menucmp(0);
@ -670,10 +675,14 @@ domenuselect(Hookdef dummy, Chdata dat)
nmatches = u->nmatches;
hasoldlist = 1;
}
zsfree(brbeg);
zsfree(brend);
brbeg = ztrdup(u->brbeg);
brend = ztrdup(u->brend);
PERMALLOC {
freebrinfo(brbeg);
freebrinfo(brend);
brbeg = dupbrinfo(u->brbeg, &lastbrbeg);
brend = dupbrinfo(u->brend, &lastbrend);
nbrbeg = u->nbrbeg;
nbrend = u->nbrend;
} LASTALLOC;
u = u->prev;
clearlist = 1;
setwish = 1;

File diff suppressed because it is too large Load diff