Skip to content

Commit bdd6458

Browse files
committed
pydoc, pylint: Skip module completion if current looks like a path
1 parent 64c1817 commit bdd6458

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

completions/pydoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ _pydoc()
2424

2525
COMPREPLY=( $( compgen -W 'keywords topics modules' -- "$cur" ) )
2626

27-
local python=python; [[ $1 == *3* ]] && python=python3
28-
_xfunc python _python_modules $python
27+
if [[ $cur != @(.|*/)* ]]; then
28+
local python=python; [[ $1 == *3* ]] && python=python3
29+
_xfunc python _python_modules $python
30+
fi
2931

3032
# Note that we don't do "pydoc modules" as it is known to hang on
3133
# some systems; _python_modules tends to work better and faster.

completions/pylint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ _pylint()
7575
return
7676
fi
7777

78-
_xfunc python _python_modules $python
78+
[[ $cur == @(.|*/)* ]] || _xfunc python _python_modules $python
7979
_filedir py
8080
} &&
8181
complete -F _pylint pylint pylint-2 pylint-3

0 commit comments

Comments
 (0)