From 8e5dd8675f4ced3b507dd701f1a9d8fc7cf3067f Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Thu, 9 Sep 1999 09:47:08 +0000 Subject: zsh-workers/7738 --- Completion/User/_man | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'Completion') 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' -- cgit 1.4.1