Skip to content

Commit 0c17476

Browse files
author
Ira Abramov
committed
only the correct FZF integration loads, sepending on whether the blesh plugin is enabled as well.
1 parent fa133ed commit 0c17476

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

plugins/available/blesh.plugin.bash

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ _bash_it_ble_path=${XDG_DATA_HOME:-$HOME/.local/share}/blesh/ble.sh
1111
if [[ -f $_bash_it_ble_path ]]; then
1212
# shellcheck disable=1090
1313
source "$_bash_it_ble_path" --attach=prompt
14+
if _bash-it-component-item-is-enabled plugin fzf; then
15+
ble-import integration/fzf-key-bindings
16+
ble-import -d integration/fzf-completion
17+
fi
1418
else
1519
_log_error "Could not find ble.sh in $_bash_it_ble_path"
1620
_log_error "Please install using the following command:"

plugins/available/fzf.plugin.bash

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
cite about-plugin
66
about-plugin 'load fzf, if you are using it'
77

8-
if [ -r ~/.fzf.bash ]; then
9-
# shellcheck disable=SC1090
10-
source ~/.fzf.bash
11-
elif [ -r "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash ]; then
12-
# shellcheck disable=SC1091
13-
source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash
14-
fi
8+
if ! _bash-it-component-item-is-enabled plugin blesh; then
9+
if [ -r ~/.fzf.bash ]; then
10+
# shellcheck disable=SC1090
11+
source ~/.fzf.bash
12+
elif [ -r "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash ]; then
13+
# shellcheck disable=SC1091
14+
source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash
15+
fi
16+
fi # only sources the keybindings and integration if blesh is not integrated already
1517

1618
# No need to continue if the command is not present
1719
_command_exists fzf || return

0 commit comments

Comments
 (0)