summaryrefslogtreecommitdiff
path: root/shell/completion.bash
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2017-01-14 01:10:34 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2017-01-14 01:10:34 +0900
commit5b68027bee72cf32d61795694a07750d6477ee92 (patch)
tree0f0038dcbf781e18372c283e13df3e1d2b9285fd /shell/completion.bash
parent48863ac55cc25f8e940cf21f5c32943de90f50c9 (diff)
downloadfzf-5b68027bee72cf32d61795694a07750d6477ee92.tar.gz
Fix $FZF_COMPLETION_OPTS evaluation
Close #799
Diffstat (limited to 'shell/completion.bash')
-rw-r--r--shell/completion.bash6
1 files changed, 3 insertions, 3 deletions
diff --git a/shell/completion.bash b/shell/completion.bash
index d6d7238d..9c4cdb1a 100644
--- a/shell/completion.bash
+++ b/shell/completion.bash
@@ -148,7 +148,7 @@ __fzf_generic_path_completion() {
leftover=${leftover/#\/}
[ -z "$dir" ] && dir='.'
[ "$dir" != "/" ] && dir="${dir/%\//}"
- matches=$(eval "$1 $(printf %q "$dir")" | $fzf $FZF_COMPLETION_OPTS $2 -q "$leftover" | while read -r item; do
+ matches=$(eval "$1 $(printf %q "$dir")" | FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS $FZF_COMPLETION_OPTS" $fzf $2 -q "$leftover" | while read -r item; do
printf "%q$3 " "$item"
done)
matches=${matches% }
@@ -183,7 +183,7 @@ _fzf_complete() {
if [[ "$cur" == *"$trigger" ]]; then
cur=${cur:0:${#cur}-${#trigger}}
- selected=$(cat | $fzf $FZF_COMPLETION_OPTS $1 -q "$cur" | $post | tr '\n' ' ')
+ selected=$(cat | FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS $FZF_COMPLETION_OPTS" $fzf $1 -q "$cur" | $post | tr '\n' ' ')
selected=${selected% } # Strip trailing space not to repeat "-o nospace"
printf '\e[5n'
@@ -215,7 +215,7 @@ _fzf_complete_kill() {
local selected fzf
fzf="$(__fzfcmd_complete)"
- selected=$(ps -ef | sed 1d | $fzf -m $FZF_COMPLETION_OPTS | awk '{print $2}' | tr '\n' ' ')
+ selected=$(ps -ef | sed 1d | FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS $FZF_COMPLETION_OPTS" $fzf -m | awk '{print $2}' | tr '\n' ' ')
printf '\e[5n'
if [ -n "$selected" ]; then