Skip to content
Myr

Merge pull request #670 from maverickwoo/fix-668

Before adoption: this commit came in with the history the project adopted, so no landing records it.

[bash-completion] Fix #668

authored by Junegunn Choi · committed by GitHub · parents 8c8b5b3, 2c8479a · Browse files · 1 file+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:shell/completion.bash+4 added-4 removed
30 unmodified lines
31###########################################################3233_fzf_orig_completion_filter() {34 sed 's/^\(.*-F\) *\([^ ]*\).* \([^ ]*\)$/export _fzf_orig_completion_\3="\1 %s \3 #\2";/' |35 awk -F= '{gsub(/[^a-z0-9_= ;]/, "_", $1); print $1"="$2}'35 awk -F= '{gsub(/[^A-Za-z0-9_= ;]/, "_", $1); print $1"="$2}'36}3738_fzf_opts_completion() {39 local cur prev opts
76 unmodified lines
116117__fzf_generic_path_completion() {118 local cur base dir leftover matches trigger cmd fzf119 [ "${FZF_TMUX:-1}" != 0 ] && fzf="fzf-tmux -d ${FZF_TMUX_HEIGHT:-40%}" || fzf="fzf"120 cmd=$(echo "${COMP_WORDS[0]}" | sed 's/[^a-z0-9_=]/_/g')120 cmd="${COMP_WORDS[0]//[^A-Za-z0-9_=]/_}"121 COMPREPLY=()122 trigger=${FZF_COMPLETION_TRIGGER-'**'}123 cur="${COMP_WORDS[COMP_CWORD]}"124 if [[ "$cur" == *"$trigger" ]]; then
36 unmodified lines
161 post="$(caller 0 | awk '{print $2}')_post"162 type -t "$post" > /dev/null 2>&1 || post=cat163 [ "${FZF_TMUX:-1}" != 0 ] && fzf="fzf-tmux -d ${FZF_TMUX_HEIGHT:-40%}" || fzf="fzf"164165 cmd=$(echo "${COMP_WORDS[0]}" | sed 's/[^a-z0-9_=]/_/g')165 cmd="${COMP_WORDS[0]//[^A-Za-z0-9_=]/_}"166 trigger=${FZF_COMPLETION_TRIGGER-'**'}167 cur="${COMP_WORDS[COMP_CWORD]}"168 if [[ "$cur" == *"$trigger" ]]; then169 cur=${cur:0:${#cur}-${#trigger}}
106 unmodified lines
276 local cmd func opts orig_var orig def277 cmd="$1"278 func="$2"279 opts="$3"280 orig_var="_fzf_orig_completion_$cmd"280 orig_var="_fzf_orig_completion_${cmd//[^A-Za-z0-9_]/_}"281 orig="${!orig_var}"282 if [ -n "$orig" ]; then283 printf -v def "$orig" "$func"284 eval "$def"
30 unmodified lines