diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 2000-01-04 09:38:14 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 2000-01-04 09:38:14 +0000 |
commit | 2f76a51352acacc7618f771dfbe2144fed9f4acd (patch) | |
tree | 56763dbdc0abd35b669200673692bd03a84bac2f /Completion | |
parent | 3259e583b0d8505c099ab76ca7cec264511c45e8 (diff) | |
download | zsh-2f76a51352acacc7618f771dfbe2144fed9f4acd.tar.gz zsh-2f76a51352acacc7618f771dfbe2144fed9f4acd.tar.xz zsh-2f76a51352acacc7618f771dfbe2144fed9f4acd.zip |
zsh-workers/9191
Diffstat (limited to 'Completion')
-rw-r--r-- | Completion/Base/_default | 4 | ||||
-rw-r--r-- | Completion/Core/_description | 13 | ||||
-rw-r--r-- | Completion/Core/_path_files | 9 |
3 files changed, 18 insertions, 8 deletions
diff --git a/Completion/Base/_default b/Completion/Base/_default index 920f3a959..8329a0358 100644 --- a/Completion/Base/_default +++ b/Completion/Base/_default @@ -1,7 +1,5 @@ #compdef -default- -local expl - # You can first try the `compctl's by uncommenting the `compcall' line # below. # This is without first (-T) and default (-D) completion. If you want @@ -22,4 +20,4 @@ _files && return 0 # file name expansion after the =. In that case, it's natural to # allow completion to handle file names after any equals sign. -[[ -o magicequalsubst ]] && compset -P 1 '*=' && _files "$expl[@]" +[[ -o magicequalsubst ]] && compset -P 1 '*=' && _files diff --git a/Completion/Core/_description b/Completion/Core/_description index b1959d018..c6a7b8807 100644 --- a/Completion/Core/_description +++ b/Completion/Core/_description @@ -1,9 +1,10 @@ #autoload -local name gropt format gname hidden hide +local name gropt format gname hidden hide match gropt=(-J) hide=() +match=() if [[ "$1" = -([12]|)[VJ] ]]; then gropt=("$1") @@ -26,21 +27,23 @@ if [[ "$hidden" = (all|yes|true|1|on) ]]; then fi zstyle -s ":completion${curcontext}:$1" group-name gname && [[ -z "$gname" ]] && gname="$1" +zstyle -s ":completion${curcontext}:$1" matcher match && + match=(-M "${(q)match}") shift 2 [[ -n "$format" ]] && zformat -f format "$format" "d:$1" "${(@)argv[2,-1]}" if [[ -n "$gname" ]]; then if [[ -n "$format" ]]; then - eval "${name}=($hide $gropt ${(q)gname} -X \"${format}\")" + eval "${name}=($hide $match $gropt ${(q)gname} -X \"${format}\")" else - eval "${name}=($hide $gropt ${(q)gname})" + eval "${name}=($hide $match $gropt ${(q)gname})" fi else if [[ -n "$format" ]]; then - eval "${name}=($hide $gropt -default- -X \"${format}\")" + eval "${name}=($hide $match $gropt -default- -X \"${format}\")" else - eval "${name}=($hide $gropt -default-)" + eval "${name}=($hide $match $gropt -default-)" fi fi diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files index 39e02fb58..9da2fdd81 100644 --- a/Completion/Core/_path_files +++ b/Completion/Core/_path_files @@ -86,6 +86,15 @@ if (( ! ( $#group + $#expl ) )); then else _description files expl file fi + tmp1=$expl[(I)-M] + if (( tmp1 )); then + match="$match $expl[1+tmp1]" + if (( $#matcher )); then + matcher[2]="$matcher[2] $expl[1+tmp1]" + else + matcher=(-M "$expl[1+tmp1]") + fi + fi fi [[ -n "$tmp1" && $#addsfx -ne 0 ]] && addsfx[1]=-qS |