From 841e51076d8ee00e0b4e49dd94d1f0f86f5d9330 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Fri, 8 Feb 2002 08:30:42 +0000 Subject: 16590: use a prefix match instead of a "fuzzy-exact" match. --- Completion/Unix/Type/_dict_words | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Completion/Unix/Type/_dict_words (limited to 'Completion') 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 -- cgit 1.4.1