man: Don't expand man page extensions too early.
Breaks for example subdir completions if there is a subdir whose name matches extensions in the current dir.
This commit is contained in:
parent
08203f7743
commit
49ea121e5d
@ -18,7 +18,7 @@ _man()
|
||||
return
|
||||
;;
|
||||
-l|--local-file)
|
||||
_filedir $manext
|
||||
_filedir "$manext"
|
||||
return
|
||||
;;
|
||||
-M|--manpath)
|
||||
@ -52,7 +52,7 @@ _man()
|
||||
|
||||
# file based completion if parameter looks like a path
|
||||
if [[ "$cur" == @(*/|[.~])* ]]; then
|
||||
_filedir $manext
|
||||
_filedir "$manext"
|
||||
return 0
|
||||
fi
|
||||
|
||||
@ -91,7 +91,7 @@ _man()
|
||||
# File based completion for the rest, prepending ./ if needed
|
||||
# (man 1.6f needs that for man pages in current dir)
|
||||
local i start=${#COMPREPLY[@]}
|
||||
_filedir $manext
|
||||
_filedir "$manext"
|
||||
for (( i=$start; i < ${#COMPREPLY[@]}; i++ )); do
|
||||
[[ ${COMPREPLY[i]} == */* ]] || COMPREPLY[i]=./${COMPREPLY[i]}
|
||||
done
|
||||
|
0
test/fixtures/man/man/quux.8
vendored
Normal file
0
test/fixtures/man/man/quux.8
vendored
Normal file
@ -30,4 +30,8 @@ assert_complete "Bash::Completion" "man Bash::C"
|
||||
sync_after_int
|
||||
|
||||
|
||||
assert_complete_dir "man/quux.8" "man man/" $::srcdir/fixtures/man
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
||||
|
Loading…
x
Reference in New Issue
Block a user