summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2004-10-01 10:29:08 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2004-10-01 10:29:08 +0000
commit1bf6bbe0b50dfa70a12c4bcaf7caa6927eb1c792 (patch)
tree8eec008a3812cdca141a83407ec28ba9f2332f72
parent0fa7015cc8ae9774c1e449688e29dee0b6aee438 (diff)
downloadzsh-1bf6bbe0b50dfa70a12c4bcaf7caa6927eb1c792.tar.gz
zsh-1bf6bbe0b50dfa70a12c4bcaf7caa6927eb1c792.zip
20427: Fix problem with _oldlist and custom completer.
20339: show-completer style
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Base/Core/_main_complete12
-rw-r--r--Doc/Zsh/compsys.yo7
3 files changed, 24 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f8a69b814..f7eb7f8d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-10-01 Peter Stephenson <pws@csr.com>
+
+ * 20427, 20339 (modified): Completion/Base/Core/_main_complete,
+ Doc/Zsh/compsys.yo: Fix for problem with _oldlist and custom
+ completion. Also snuck in show-completer style with documentation.
+
2004-09-30 Clint Adams <clint@zsh.org>
* 20358: Completion/Unix/Command/_make: avoid potential gawk
diff --git a/Completion/Base/Core/_main_complete b/Completion/Base/Core/_main_complete
index 5712a9284..b6f676d43 100644
--- a/Completion/Base/Core/_main_complete
+++ b/Completion/Base/Core/_main_complete
@@ -135,7 +135,10 @@ for tmp in "$_completers[@]"; do
else
_completer="${tmp[2,-1]//_/-}"
fi
+
curcontext="${curcontext/:[^:]#:/:${_completer}:}"
+ zstyle -t ":completion:${curcontext}:" show-completer &&
+ zle -R "Trying completion for :completion:${curcontext}"
zstyle -a ":completion:${curcontext}:" matcher-list _matchers ||
_matchers=( '' )
@@ -167,7 +170,14 @@ for tmp in "$_completers[@]"; do
done
curcontext="${curcontext/:[^:]#:/::}"
-nm=$compstate[nmatches]
+if [[ $compstate[old_list] = keep ]]; then
+ # We are keeping the old list of matches, so keep the
+ # number of matches we found last time rather than the
+ # number just generated.
+ nm=$_lastcomp[nmatches]
+else
+ nm=$compstate[nmatches]
+fi
if [[ $compstate[old_list] = keep || nm -gt 1 ]]; then
[[ _last_nmatches -ge 0 && _last_nmatches -ne nm ]] &&
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index 9a30229bb..63b7086b3 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -2147,6 +2147,13 @@ completing words for the dict command. It allows words from different
dictionary databases to be added separately.
The default for this style is `false'.
)
+kindex(show-completer, completion style)
+item(tt(show-completer))(
+Tested whenever a new completer is tried. If it is true, the completion
+system outputs a progress message in the listing area showing what
+completer is being tried. The message will be overwritten by any output
+when completions are found and is removed after completion is finished.
+)
kindex(single-ignored, completion style)
item(tt(single-ignored))(
This is used by the tt(_ignored) completer when there is only one match.