diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-05-09 11:04:44 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-05-09 11:04:44 +0000 |
commit | 8c6a5af791ea0ccf44b71577b4cb1a9cec92646c (patch) | |
tree | ac410f43b25caababd99f5b4987aeb7d2d66ccac /Completion | |
parent | 8a5fb55595d730a0e1fc3a15ff5f69c58e9bdb5b (diff) | |
download | zsh-8c6a5af791ea0ccf44b71577b4cb1a9cec92646c.tar.gz zsh-8c6a5af791ea0ccf44b71577b4cb1a9cec92646c.tar.xz zsh-8c6a5af791ea0ccf44b71577b4cb1a9cec92646c.zip |
give control over insertion of tab when no non-blank character before cursor; add insert-tab style (11274)
Diffstat (limited to 'Completion')
-rw-r--r-- | Completion/Builtins/_zstyle | 1 | ||||
-rw-r--r-- | Completion/Core/_main_complete | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/Completion/Builtins/_zstyle b/Completion/Builtins/_zstyle index 9f5bf9352..7428a3b0f 100644 --- a/Completion/Builtins/_zstyle +++ b/Completion/Builtins/_zstyle @@ -40,6 +40,7 @@ styles=( ignore-parents c:ignorepar ignored-patterns c: insert-ids c:insert-ids + insert-tab c:bool insert-unambiguous c:bool last-prompt c:bool list c:listwhen diff --git a/Completion/Core/_main_complete b/Completion/Core/_main_complete index f079e38e2..aa061ec91 100644 --- a/Completion/Core/_main_complete +++ b/Completion/Core/_main_complete @@ -34,6 +34,12 @@ typeset -U _lastdescr _comp_ignore [[ -z "$curcontext" ]] && curcontext=::: +if [[ "$compstate[insert]" = tab* ]]; then + zstyle -T ":completion:${curcontext}:" insert-tab && return 1 + + compstate[insert]="${compstate[insert]//tab /}" +fi + # Special completion contexts after `~' and `='. if compset -P 1 '='; then |