diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-04-15 18:10:10 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-04-15 18:10:10 +0000 |
commit | 2a5a899a55fd2bce10efd01c75a4bec5285aa46c (patch) | |
tree | 4744bc2f1a6b86fc1b12870be94edf96fdab4879 /Src/Zle/zle_tricky.c | |
parent | 9003d99d16c46b5679da7fcf1f2a41adef495ff9 (diff) | |
download | zsh-2a5a899a55fd2bce10efd01c75a4bec5285aa46c.tar.gz zsh-2a5a899a55fd2bce10efd01c75a4bec5285aa46c.tar.xz zsh-2a5a899a55fd2bce10efd01c75a4bec5285aa46c.zip |
zsh-3.1.5-pws-4 zsh-3.1.5-pws-4
Diffstat (limited to 'Src/Zle/zle_tricky.c')
-rw-r--r-- | Src/Zle/zle_tricky.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index cbc744601..8c976449e 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -3801,15 +3801,23 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd) /* Completion after `~', maketildelist adds the usernames * * and named directories. */ - if (ic == Tilde) + if (ic == Tilde) { + char *oi = ipre; + + ipre = (ipre ? dyncat("~", ipre) : "~"); maketildelist(); - else if (ic == Equals) { + ipre = oi; + } else if (ic == Equals) { /* Completion after `=', get the command names from * * the cmdnamtab and aliases from aliastab. */ + char *oi = ipre; + + ipre = (ipre ? dyncat("=", ipre) : "="); if (isset(HASHLISTALL)) cmdnamtab->filltable(cmdnamtab); dumphashtable(cmdnamtab, -7); dumphashtable(aliastab, -2); + ipre = oi; } else { /* Normal file completion... */ if (ispattern & 1) { @@ -4082,6 +4090,7 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd) if ((list = getshfunc(cc->func)) != &dummy_list) { /* We have it, so build a argument list. */ LinkList args = newlinklist(); + int osc = sfcontext; addlinknode(args, cc->func); @@ -4099,8 +4108,10 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd) /* This flag allows us to use read -l and -c. */ incompctlfunc = 1; + sfcontext = SFC_COMPLETE; /* Call the function. */ doshfunc(cc->func, list, args, 0, 1); + sfcontext = osc; incompctlfunc = 0; /* And get the result from the reply parameter. */ if ((r = get_user_var("reply"))) @@ -4246,6 +4257,7 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd) LinkList args = newlinklist(); LinkNode ln; Cmatch m; + int osc = sfcontext; addlinknode(args, cc->ylist); for (ln = firstnode(matches); ln; ln = nextnode(ln)) { @@ -4263,7 +4275,9 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd) /* No harm in allowing read -l and -c here, too */ incompctlfunc = 1; + sfcontext = SFC_COMPLETE; doshfunc(cc->ylist, list, args, 0, 1); + sfcontext = osc; incompctlfunc = 0; uv = "reply"; } |