summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authordana <dana@dana.is>2020-01-05 12:13:01 -0600
committerdana <dana@dana.is>2020-01-05 12:13:01 -0600
commit0d3a62d931543f95e31100f07f9a5b693dc0b343 (patch)
treefca4149518f43b6ac83794637445274436daf0a6 /Completion
parent2e521d7b631e46d64ac8b274c8fe84bf21cb83ea (diff)
downloadzsh-0d3a62d931543f95e31100f07f9a5b693dc0b343.tar.gz
zsh-0d3a62d931543f95e31100f07f9a5b693dc0b343.tar.xz
zsh-0d3a62d931543f95e31100f07f9a5b693dc0b343.zip
45226: _man: Improve completion of file paths
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_man9
1 files changed, 8 insertions, 1 deletions
diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man
index 41ae85a1f..7d55201e3 100644
--- a/Completion/Unix/Command/_man
+++ b/Completion/Unix/Command/_man
@@ -381,7 +381,12 @@ _man() {
 
     (( $#sects )) || return 1
 
-    _tags manuals.${^sects}
+    if [[ $PREFIX$SUFFIX == */* ]]; then
+      _tags manuals.${^sects} files
+    else
+      _tags manuals.${^sects}
+    fi
+
     while _tags; do
       for sect_dirname in $sects; do
         d=$sect_dirname
@@ -390,6 +395,8 @@ _man() {
         _requested manuals.$sect_dirname expl "manual page, section $d" _man_pages &&
             ret=0
       done
+      [[ $PREFIX$SUFFIX == */* ]] &&
+      _requested files expl directory _files -/ && ret=0
       (( ret )) || return 0
     done
     ## To fall back to other sections' manpages when completing filenames, like