about summary refs log tree commit diff
path: root/Completion/Unix/Command/_man
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-01-14 15:37:43 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2016-01-18 02:40:02 +0000
commit896f43c72bcfd3f1e2240f54609868634a3c4e45 (patch)
tree82ba8cd93a9e8e176d75355a2fc06242d7d92016 /Completion/Unix/Command/_man
parent35b8e8794f00987b4b9380f5f20f6ca6ec64b7c3 (diff)
downloadzsh-896f43c72bcfd3f1e2240f54609868634a3c4e45.tar.gz
zsh-896f43c72bcfd3f1e2240f54609868634a3c4e45.tar.xz
zsh-896f43c72bcfd3f1e2240f54609868634a3c4e45.zip
37634: _man: Support subsection names such as '3p'.
Diffstat (limited to 'Completion/Unix/Command/_man')
-rw-r--r--Completion/Unix/Command/_man4
1 files changed, 2 insertions, 2 deletions
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))