about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-08 08:44:52 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-08 08:44:52 +0000
commitbedd4cf2c57a89bec8bd98e6ed65082164b69d93 (patch)
treed7a24e4699e0574717e9f156e63212047cf2ccba /Completion
parent92637abbb870dc35e1af9150741f7b11587a3350 (diff)
downloadzsh-bedd4cf2c57a89bec8bd98e6ed65082164b69d93.tar.gz
zsh-bedd4cf2c57a89bec8bd98e6ed65082164b69d93.tar.xz
zsh-bedd4cf2c57a89bec8bd98e6ed65082164b69d93.zip
make _expand call _complete when called from _expand_word; add ignore-line style to ignore words already on the line (11244)
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Builtins/_zstyle1
-rw-r--r--Completion/Core/_description13
-rw-r--r--Completion/Core/_expand1
3 files changed, 12 insertions, 3 deletions
diff --git a/Completion/Builtins/_zstyle b/Completion/Builtins/_zstyle
index 995c8c6f2..9f5bf9352 100644
--- a/Completion/Builtins/_zstyle
+++ b/Completion/Builtins/_zstyle
@@ -36,6 +36,7 @@ styles=(
   hosts			 c:_hosts
   hosts-ports		 c:host-port
   users-hosts-ports	 c:user-host-port
+  ignore-line            c:bool
   ignore-parents         c:ignorepar
   ignored-patterns	 c:
   insert-ids             c:insert-ids
diff --git a/Completion/Core/_description b/Completion/Core/_description
index 6ee1026bd..9ea478ec5 100644
--- a/Completion/Core/_description
+++ b/Completion/Core/_description
@@ -29,9 +29,16 @@ zstyle -s ":completion:${curcontext}:$1" matcher match &&
     opts=($opts -M "${(q)match}")
 [[ -n "$_matcher" ]] && opts=($opts -M "${(q)_matcher}")
 
-if [[ -z "$_comp_no_ignore" ]] &&
-   zstyle -a ":completion:${curcontext}:$1" ignored-patterns _comp_ignore; then
-  opts=( $opts -F _comp_ignore )
+if [[ -z "$_comp_no_ignore" ]]; then
+  if zstyle -a ":completion:${curcontext}:$1" ignored-patterns _comp_ignore; then
+    opts=( $opts -F _comp_ignore )
+    zstyle -t ":completion:${curcontext}:$1" ignore-line &&
+        _comp_ignore=( "$_comp_ignore[@]" "$words[@]}" )
+  elif zstyle -t ":completion:${curcontext}:$1" ignore-line; then
+    _comp_ignore=( "$words[@]}]" )
+  else
+    _comp_ignore=()
+  fi
 else
   _comp_ignore=()
 fi
diff --git a/Completion/Core/_expand b/Completion/Core/_expand
index 985f21899..987a597c7 100644
--- a/Completion/Core/_expand
+++ b/Completion/Core/_expand
@@ -30,6 +30,7 @@ if [[ "$force" = *c* ]] ||
    { zstyle -s ":completion:${curcontext}:" completions expr &&
      [[ "${(e):-\$[$expr]}" -eq 1 ]] }; then
   compstate[insert]=all
+  [[ "$curcontext" = expand-word:* ]] && _complete && return 0
   return 1
 fi