diff options
author | Clint Adams <clint@users.sourceforge.net> | 2002-02-08 08:30:42 +0000 |
---|---|---|
committer | Clint Adams <clint@users.sourceforge.net> | 2002-02-08 08:30:42 +0000 |
commit | 841e51076d8ee00e0b4e49dd94d1f0f86f5d9330 (patch) | |
tree | 32f1bb57f5b682cd923208d6a47a5b860d1cc99a /Completion/Unix/Type/_dict_words | |
parent | e8b50bdf0f8871359cd97c503604a9a2ed588e1d (diff) | |
download | zsh-841e51076d8ee00e0b4e49dd94d1f0f86f5d9330.tar.gz zsh-841e51076d8ee00e0b4e49dd94d1f0f86f5d9330.tar.xz zsh-841e51076d8ee00e0b4e49dd94d1f0f86f5d9330.zip |
16590: use a prefix match instead of a "fuzzy-exact" match.
Diffstat (limited to 'Completion/Unix/Type/_dict_words')
-rw-r--r-- | Completion/Unix/Type/_dict_words | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Completion/Unix/Type/_dict_words b/Completion/Unix/Type/_dict_words new file mode 100644 index 000000000..770319036 --- /dev/null +++ b/Completion/Unix/Type/_dict_words @@ -0,0 +1,17 @@ +#autoload + +local dict dictresult dictwords j expl + +[[ -z $words[CURRENT] ]] && return 1 + +dictresults=(${${(f)${"$(dict -m -s prefix $words[CURRENT])":gs/ + / /}}:#[0-9]*matches found}) + +for j in ${dictresults} +do + dict=${j%%:*} + dictwords=(${(z)j#*:}) + + _wanted $dict expl "words from $dict" \ + compadd -M 'm:{a-zA-Z}={A-Za-z} r:|=*' -a "$@" - dictwords +done |