mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-06-13 04:56:30 +02:00
38994: _man: Fix two bugs when completing manpage filenames in separate-sections mode.
- No longer glob all files (the (-g)-less _path_files was virtually always called, by at least one of the multiple calls to _man_pages). - Actually separate sections (by propagating $expl).
This commit is contained in:
parent
a5a9fc7a5f
commit
71f1653020
|
@ -1,5 +1,8 @@
|
|||
2016-08-05 Daniel Shahaf <d.s@daniel.shahaf.name>
|
||||
|
||||
* 38994: Completion/Unix/Command/_man: Fix two bugs when
|
||||
completing manpage filenames in separate-sections mode.
|
||||
|
||||
* 38993: Completion/Unix/Command/_man: Drop (b): it's incorrect
|
||||
when $sect contains '|'.
|
||||
|
||||
|
|
|
@ -87,6 +87,13 @@ _man() {
|
|||
done
|
||||
(( ret )) || return 0
|
||||
done
|
||||
## To fall back to other sections' manpages when completing filenames, like
|
||||
## the 'else' codepath does:
|
||||
#
|
||||
# if (( ret )) && [[ $PREFIX$SUFFIX == */* ]]; then
|
||||
# sect_dirname=
|
||||
# _wanted manuals expl 'manual page' _man_pages && return
|
||||
# fi
|
||||
|
||||
return 1
|
||||
else
|
||||
|
@ -105,9 +112,13 @@ _man_pages() {
|
|||
# Easy way to test for versions of man that allow file names.
|
||||
# This can't be a normal man page reference.
|
||||
# Try to complete by glob first.
|
||||
_path_files -g "*$suf" && return
|
||||
_path_files
|
||||
return
|
||||
if [[ -n $sect_dirname ]]; then
|
||||
_path_files -g "*.*$sect_dirname*(|.gz|.bz2|.Z|.lzma)" "$expl[@]"
|
||||
else
|
||||
_path_files -g "*$suf" "$expl[@]" && return
|
||||
_path_files "$expl[@]"
|
||||
fi
|
||||
return $?
|
||||
fi
|
||||
|
||||
zparseopts -E M+:=matcher
|
||||
|
|
Loading…
Reference in New Issue