mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-22 21:05:09 +00:00
[bash-completion] Always backup existing completion definitions
_fzf_completion_loaded is no longer checked. This change increases the load time by a few milliseconds, but I can't think of a better way to handle the issue. Close #783.
This commit is contained in:
parent
7b0d9e1e07
commit
73eacf1137
@ -261,12 +261,9 @@ a_cmds="
|
|||||||
x_cmds="kill ssh telnet unset unalias export"
|
x_cmds="kill ssh telnet unset unalias export"
|
||||||
|
|
||||||
# Preserve existing completion
|
# Preserve existing completion
|
||||||
if [ "$_fzf_completion_loaded" != '0.11.3' ]; then
|
eval $(complete |
|
||||||
# Really wish I could use associative array but OSX comes with bash 3.2 :(
|
sed -E '/-F/!d; / _fzf/d; '"/ ($(echo $d_cmds $a_cmds $x_cmds | sed 's/ /|/g; s/+/\\+/g'))$/"'!d' |
|
||||||
eval $(complete | command grep '\-F' | command grep -v _fzf_ |
|
_fzf_orig_completion_filter)
|
||||||
command grep -E " ($(echo $d_cmds $a_cmds $x_cmds | sed 's/ /|/g' | sed 's/+/\\+/g'))$" | _fzf_orig_completion_filter)
|
|
||||||
export _fzf_completion_loaded=0.11.3
|
|
||||||
fi
|
|
||||||
|
|
||||||
if type _completion_loader > /dev/null 2>&1; then
|
if type _completion_loader > /dev/null 2>&1; then
|
||||||
_fzf_completion_loader=1
|
_fzf_completion_loader=1
|
||||||
|
Loading…
Reference in New Issue
Block a user