Skip to content

Commit

Permalink
Update FZF_COMPLETIONS_D handling
Browse files Browse the repository at this point in the history
Only add `FZF_COMPLETIONS_D` to `fpath` when it is an existing directory.

Signed-off-by: Joe Block <[email protected]>
  • Loading branch information
unixorn committed Mar 9, 2024
1 parent 47b6dfb commit 2c2bb7c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fzf-zsh-plugin.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ fi
unset FZF_PLUGIN_BIN

local FZF_COMPLETIONS_D="$(dirname $0)/completions"
export fpath=($FZF_COMPLETIONS_D "${fpath[@]}" )
if [[ -d "$FZF_COMPLETIONS_D" ]]; then
export fpath=($FZF_COMPLETIONS_D "${fpath[@]}" )
fi
unset FZF_COMPLETIONS_D

function _fzf_has() {
Expand Down Expand Up @@ -125,7 +127,6 @@ _fzf_preview() {
[[ -z "$FZF_PREVIEW_WINDOW" ]] && export FZF_PREVIEW_WINDOW=':hidden'
if [[ -z "$FZF_DEFAULT_OPTS" ]]; then
fzf_default_opts+=(
"--layout=reverse"
"--info=inline"
"--height=80%"
"--multi"
Expand Down

0 comments on commit 2c2bb7c

Please sign in to comment.