diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-05-02 10:30:41 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-05-02 10:30:41 +0000 |
commit | 997d40c05d608fd849bb0f4377f31218dc266b02 (patch) | |
tree | c7c222feed8b09bf976fd3d50b7209dc3b2898f7 /Src/Zle/compcore.c | |
parent | 304d5f9b3974f33c566b8e57bc1b79a99e9955d9 (diff) | |
download | zsh-997d40c05d608fd849bb0f4377f31218dc266b02.tar.gz zsh-997d40c05d608fd849bb0f4377f31218dc266b02.tar.xz zsh-997d40c05d608fd849bb0f4377f31218dc266b02.zip |
add -x option to compadd to display message unconditionally
Diffstat (limited to 'Src/Zle/compcore.c')
-rw-r--r-- | Src/Zle/compcore.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index 8e713348f..44ec8ef6a 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -1538,6 +1538,8 @@ addmatches(Cadata dat, char **argv) endcmgroup(NULL); begcmgroup("default", 0); } + if (dat->mesg) + addmesg(dat->mesg); } SWITCHBACKHEAPS; return 1; @@ -1785,6 +1787,8 @@ addmatches(Cadata dat, char **argv) endcmgroup(NULL); begcmgroup("default", 0); } + if (dat->mesg) + addmesg(dat->mesg); if (*argv) { if (dat->pre) dat->pre = dupstring(dat->pre); @@ -2366,6 +2370,28 @@ addexpl(void) newmatches = 1; } +/* Add a message to the current group. Make sure it is shown. */ + +/**/ +mod_export void +addmesg(char *mesg) +{ + LinkNode n; + Cexpl e; + + for (n = firstnode(expls); n; incnode(n)) { + e = (Cexpl) getdata(n); + if (!strcmp(mesg, e->str)) + return; + } + e = (Cexpl) zhalloc(sizeof(*e)); + e->count = e->fcount = 1; + e->str = dupstring(mesg); + addlinknode(expls, e); + newmatches = 1; + mgroup->new = 1; +} + /* The comparison function for matches (used for sorting). */ /**/ |