summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_man4
2 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 72acb9123..d64e2c121 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2016-01-18 Daniel Shahaf <d.s@daniel.shahaf.name>
+ * 37634: Completion/Unix/Command/_man: _man: Support subsection
+ names such as '3p'.
+
* 37634: Completion/Unix/Command/_man: _man: Disentangle a local
variable that had two distinct semantics. No functional change
diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man
index 871af4854..0534db753 100644
--- a/Completion/Unix/Command/_man
+++ b/Completion/Unix/Command/_man
@@ -52,7 +52,7 @@ _man() {
fi
if [[ $sect = (<->*|1M|l|n) || $sect = \(*\|*\) ]]; then
- dirs=( $^_manpath/(sman|man|cat)${~sect}/ )
+ dirs=( $^_manpath/(sman|man|cat)${~sect%%[^0-9]#}/ )
awk="\$2 == \"$sect\" {print \$1}"
else
dirs=( $^_manpath/(sman|man|cat)*/ )
@@ -111,7 +111,7 @@ _man_pages() {
fi
pages=( ${(M)dirs:#*$sect_dirname/} )
- compfiles -p pages '' '' "$matcher" '' dummy "*"
+ compfiles -p pages '' '' "$matcher" '' dummy "*${(b)sect}*"
pages=( ${^~pages}(N:t) )
(($#mrd)) && pages[$#pages+1]=($(awk $awk $mrd))