diff options
author | Oliver Kiddle <opk@zsh.org> | 2014-03-03 12:08:45 +0100 |
---|---|---|
committer | Oliver Kiddle <opk@zsh.org> | 2014-03-03 12:08:45 +0100 |
commit | 1f290a3e8277347a782a7766948aab47c10120c8 (patch) | |
tree | b3d7fcacddcc49416d33214d6bf6cd9959deae98 /Completion/Base | |
parent | b5fcc04f0e29ff00cb72b0e5c0bc9976c1c5eb33 (diff) | |
download | zsh-1f290a3e8277347a782a7766948aab47c10120c8.tar.gz zsh-1f290a3e8277347a782a7766948aab47c10120c8.tar.xz zsh-1f290a3e8277347a782a7766948aab47c10120c8.zip |
32439: add new show-ambiguity style
Diffstat (limited to 'Completion/Base')
-rw-r--r-- | Completion/Base/Core/_main_complete | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Completion/Base/Core/_main_complete b/Completion/Base/Core/_main_complete index 8dd781dbb..e881ea6a1 100644 --- a/Completion/Base/Core/_main_complete +++ b/Completion/Base/Core/_main_complete @@ -334,6 +334,14 @@ elif [[ nm -eq 0 && -z "$_comp_mesg" && compadd -x "$mesg" fi +if zstyle -s ":completion:${curcontext}:" show-ambiguity tmp; then + local prefix=${${compstate[unambiguous]}[1,${compstate[unambiguous_cursor]}-1]} + local toquote='[=\(\)\|~^?*[\]#<>]' + [[ $tmp = (yes|true|on) ]] && tmp=4 + [[ -n $prefix ]] && + _comp_colors+=( "=(#i)${prefix[1,-2]//?/(}${prefix[1,-2]//(#m)?/${MATCH/$~toquote/\\$MATCH}|)}${prefix[-1]//(#m)$~toquote/\\$MATCH}(#b)(?|)*==$tmp" ) +fi + [[ "$_comp_force_list" = always || ( "$_comp_force_list" = ?* && nm -ge _comp_force_list ) ]] && compstate[list]="${compstate[list]//messages} force" |