about summary refs log tree commit diff
path: root/Completion/User/_man
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-09 09:47:08 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-09 09:47:08 +0000
commit8e5dd8675f4ced3b507dd701f1a9d8fc7cf3067f (patch)
tree5c5b758edef11953f91c69c2ff10e4e3060fecef /Completion/User/_man
parent2aaebab3162c91cf44ea05e6dabae6c20894b5b0 (diff)
downloadzsh-8e5dd8675f4ced3b507dd701f1a9d8fc7cf3067f.tar.gz
zsh-8e5dd8675f4ced3b507dd701f1a9d8fc7cf3067f.tar.xz
zsh-8e5dd8675f4ced3b507dd701f1a9d8fc7cf3067f.zip
zsh-workers/7738
Diffstat (limited to 'Completion/User/_man')
-rw-r--r--Completion/User/_man17
1 files changed, 14 insertions, 3 deletions
diff --git a/Completion/User/_man b/Completion/User/_man
index 049fa7db7..ebe9a432e 100644
--- a/Completion/User/_man
+++ b/Completion/User/_man
@@ -2,12 +2,23 @@
 
 setopt localoptions rcexpandparam
 
-local rep expl
+local rep expl star approx
+
+if [[ $compstate[pattern_match] != [^*] ]]; then
+  # If a string other than *, we just want correction, so no `*'.
+  star='*'
+fi
+
+if [[ -n $_comp_correct ]]; then
+  # If this is set, we are correcting with this many approximations.
+  approx="(#a${_comp_correct})"
+fi
 
 if [[ $words[2] = (<->*|ln) ]]; then
-  rep=( $manpath/(man|cat)${words[2]}/$PREFIX*$SUFFIX.<->*(N:t:r) )
+  rep=(
+  $manpath/(man|cat)${words[2]}/${~approx}$PREFIX${~star}$SUFFIX.<->*(N:t:r) )
 else
-  rep=( $manpath/(man|cat)*/$PREFIX*$SUFFIX.<->*(N:t:r) )
+  rep=( $manpath/(man|cat)*/${~approx}$PREFIX${~star}$SUFFIX.<->*(N:t:r) )
 fi
 
 _description expl 'manual page'