Skip to content
Myr

[zsh-completion] Fix prefix extraction when triggers start with ';'

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

authored by zhaoyunfeng · committed by Junegunn Choi · parent 68683c4 · Browse files · 1 file+6 added−0 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+6 added−0 removed

  • other:+6 added−0 removed

1 file+6 added−0 removed

modified:shell/completion.zsh+6 added
156 unmodified lines
157 # Explicitly allow for empty trigger.158 trigger=${FZF_COMPLETION_TRIGGER-'**'}159 [ -z "$trigger" -a ${LBUFFER[-1]} = ' ' ] && tokens+=("")160161 # When the trigger starts with ';', it becomes a separate token162 if [[ ${LBUFFER} = *"${tokens[-2]}${tokens[-1]}" ]]; then163 tokens[-2]="${tokens[-2]}${tokens[-1]}"164 tokens=(${tokens[0,-2]})165 fi166167 tail=${LBUFFER:$(( ${#LBUFFER} - ${#trigger} ))}168 # Kill completion (do not require trigger sequence)169 if [ $cmd = kill -a ${LBUFFER[-1]} = ' ' ]; then170 fzf="$(__fzfcmd_complete)"
35 unmodified lines