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
|
return
|
||||||
;;
|
;;
|
||||||
-l|--local-file)
|
-l|--local-file)
|
||||||
_filedir $manext
|
_filedir "$manext"
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
-M|--manpath)
|
-M|--manpath)
|
||||||
@ -52,7 +52,7 @@ _man()
|
|||||||
|
|
||||||
# file based completion if parameter looks like a path
|
# file based completion if parameter looks like a path
|
||||||
if [[ "$cur" == @(*/|[.~])* ]]; then
|
if [[ "$cur" == @(*/|[.~])* ]]; then
|
||||||
_filedir $manext
|
_filedir "$manext"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ _man()
|
|||||||
# File based completion for the rest, prepending ./ if needed
|
# File based completion for the rest, prepending ./ if needed
|
||||||
# (man 1.6f needs that for man pages in current dir)
|
# (man 1.6f needs that for man pages in current dir)
|
||||||
local i start=${#COMPREPLY[@]}
|
local i start=${#COMPREPLY[@]}
|
||||||
_filedir $manext
|
_filedir "$manext"
|
||||||
for (( i=$start; i < ${#COMPREPLY[@]}; i++ )); do
|
for (( i=$start; i < ${#COMPREPLY[@]}; i++ )); do
|
||||||
[[ ${COMPREPLY[i]} == */* ]] || COMPREPLY[i]=./${COMPREPLY[i]}
|
[[ ${COMPREPLY[i]} == */* ]] || COMPREPLY[i]=./${COMPREPLY[i]}
|
||||||
done
|
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
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_dir "man/quux.8" "man man/" $::srcdir/fixtures/man
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
teardown
|
teardown
|
||||||
|
Loading…
x
Reference in New Issue
Block a user