summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--Completion/Unix/Command/_man13
2 files changed, 4 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 82178dfdc..5ab0f3b7b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2016-08-05 Daniel Shahaf <d.s@daniel.shahaf.name>
+ * 38996: Completion/Unix/Command/_man: Support _correct_word.
+
* 38994: Completion/Unix/Command/_man: Fix two bugs when
completing manpage filenames in separate-sections mode.
diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man
index ffe53be5e..ae6ac38cc 100644
--- a/Completion/Unix/Command/_man
+++ b/Completion/Unix/Command/_man
@@ -103,7 +103,7 @@ _man() {
}
_man_pages() {
- local matcher pages dummy sopt
+ local pages sopt
# What files corresponding to manual pages can end in.
local suf='.((?|<->*)(|.gz|.bz2|.Z|.lzma))'
@@ -121,17 +121,8 @@ _man_pages() {
return $?
fi
- zparseopts -E M+:=matcher
-
- if (( $#matcher )); then
- matcher=( ${matcher:#-M} )
- matcher="$matcher"
- else
- matcher=
- fi
-
pages=( ${(M)dirs:#*$sect_dirname/} )
- compfiles -p pages '' '' "$matcher" '' dummy "*${sect}*"
+ pages=( ${^pages}/"*$sect${sect:+"*"}" );
pages=( ${^~pages}(N:t) )
(($#mrd)) && pages[$#pages+1]=($(awk $awk $mrd))