summaryrefslogtreecommitdiff
path: root/Src/Zle/computil.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-22 08:42:36 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-22 08:42:36 +0000
commitb9a533f3823c3b6d69fad80a21f573670856823f (patch)
treeeca8b47b9101c1060f41500f9fb23e679ec8f94f /Src/Zle/computil.c
parent44b34667f844ce57b5b2eba0f2870c1ec7630348 (diff)
downloadzsh-b9a533f3823c3b6d69fad80a21f573670856823f.tar.gz
zsh-b9a533f3823c3b6d69fad80a21f573670856823f.zip
allow subscripts for compadd -[ak]; new style for history completion; better list-colors handling (12029)
Diffstat (limited to 'Src/Zle/computil.c')
-rw-r--r--Src/Zle/computil.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index da72a6902..a329d34d0 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -3200,7 +3200,7 @@ cfp_matcher_pats(char *matcher, char *add)
}
}
if (*add) {
- char *ret = "", buf[259], *oadd = add;
+ char *ret = "", buf[259];
for (mp = ms; *add; add++, mp++) {
if (!(m = *mp)) {
@@ -3661,6 +3661,32 @@ bin_compfiles(char *nam, char **args, char *ops, int func)
return 1;
}
+static int
+bin_compgroups(char *nam, char **args, char *ops, int func)
+{
+ Heap oldheap;
+ char *n;
+
+ SWITCHHEAPS(oldheap, compheap) {
+ while ((n = *args++)) {
+ endcmgroup(NULL);
+ begcmgroup(n, 0);
+ endcmgroup(NULL);
+ begcmgroup(n, CGF_NOSORT);
+ endcmgroup(NULL);
+ begcmgroup(n, CGF_UNIQALL);
+ endcmgroup(NULL);
+ begcmgroup(n, CGF_NOSORT|CGF_UNIQCON);
+ endcmgroup(NULL);
+ begcmgroup(n, CGF_UNIQALL);
+ endcmgroup(NULL);
+ begcmgroup(n, CGF_NOSORT|CGF_UNIQCON);
+ }
+ } SWITCHBACKHEAPS(oldheap);
+
+ return 0;
+}
+
static struct builtin bintab[] = {
BUILTIN("compdescribe", 0, bin_compdescribe, 3, -1, 0, NULL, NULL),
BUILTIN("comparguments", 0, bin_comparguments, 1, -1, 0, NULL, NULL),
@@ -3670,6 +3696,7 @@ static struct builtin bintab[] = {
BUILTIN("comptry", 0, bin_comptry, 0, -1, 0, NULL, NULL),
BUILTIN("compfmt", 0, bin_compfmt, 2, -1, 0, NULL, NULL),
BUILTIN("compfiles", 0, bin_compfiles, 1, -1, 0, NULL, NULL),
+ BUILTIN("compgroups", 0, bin_compgroups, 1, -1, 0, NULL, NULL),
};