diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-06-13 11:45:26 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-06-13 11:45:26 +0000 |
commit | a707108a7544b9c2e5bd99cf51a4c5ba08558ade (patch) | |
tree | 6ed9560ed61e67132e547842fbe50affc32a86e4 /Completion | |
parent | 428abf6455c9df0dfaca05165764eb842da7e2d9 (diff) | |
download | zsh-a707108a7544b9c2e5bd99cf51a4c5ba08558ade.tar.gz zsh-a707108a7544b9c2e5bd99cf51a4c5ba08558ade.tar.xz zsh-a707108a7544b9c2e5bd99cf51a4c5ba08558ade.zip |
allow insert-tab to contain `pending[=num]' to handle the case when there is pending input (?)
Diffstat (limited to 'Completion')
-rw-r--r-- | Completion/Core/_main_complete | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Completion/Core/_main_complete b/Completion/Core/_main_complete index 39c8f0e5e..b677bc422 100644 --- a/Completion/Core/_main_complete +++ b/Completion/Core/_main_complete @@ -23,7 +23,7 @@ exec </dev/null # ZLE closes stdin, which can cause errors # Failed returns from this code are not real errors setopt localtraps noerrexit ; trap - ZERR -local func funcs ret=1 tmp _compskip format nm call \ +local func funcs ret=1 tmp _compskip format nm call match \ _completers _completer _completer_num curtag _comp_force_list \ _matchers _matcher _matcher_num _comp_tags _comp_mesg \ context state line opt_args val_args curcontext="$curcontext" \ @@ -38,8 +38,18 @@ typeset -U _lastdescr _comp_ignore [[ -z "$curcontext" ]] && curcontext=::: -if [[ "$compstate[insert]" = tab* && "$WIDGET" != *list* ]]; then - { zstyle -T ":completion:${curcontext}:" insert-tab && +zstyle -s ":completion:${curcontext}:" insert-tab tmp || tmp=no + +if [[ "$tmp" = *pending(|[[:blank:]]*) || + ( "$tmp" = *pending=(#b)([0-9]##)(|[[:blank:]]*) && + PENDING -ge $match[1] ) ]]; then + compstate[insert]=tab + + return 0 +fi + +if [[ "$compstate[insert]" = tab* ]]; then + { "$tmp" = (|[[:blank:]]*)(yes|true|on|1)(|[[:blank:]]*) && { [[ "$curcontext" != :* || -z "$compstate[vared]" ]] || zstyle -t ":completion:vared${curcontext}:" insert-tab } } && return 0 |