summary refs log tree commit diff
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
parent2e521d7b631e46d64ac8b274c8fe84bf21cb83ea (diff)
downloadzsh-0d3a62d931543f95e31100f07f9a5b693dc0b343.tar.gz
zsh-0d3a62d931543f95e31100f07f9a5b693dc0b343.tar.xz
zsh-0d3a62d931543f95e31100f07f9a5b693dc0b343.zip
45226: _man: Improve completion of file paths
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_man9
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c15b901df..31c2d66c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2020-01-05  dana  <dana@dana.is>
 
+	* 45226 (with Daniel, 45223): Completion/Unix/Command/_man:
+	Improve completion of file paths
+
 	* 45184: Doc/Zsh/compsys.yo, Doc/Zsh/compwid.yo: Clarify
 	documentation of %-sequences understood by compadd -[Xx]
 
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