Skip to content

Commit

Permalink
fix: regression for backslash-prefixed commands
Browse files Browse the repository at this point in the history
Ref: issue #1973
  • Loading branch information
LangLangBart committed Nov 12, 2024
1 parent f09888f commit 4024a29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions shell/completion.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ __fzf_extract_command() {
# Control completion with the "compstate" parameter, insert and list nothing
compstate[insert]=
compstate[list]=
cmd_word="${words[1]}"
cmd_word="${(Q)words[1]}"
}

__fzf_generic_path_completion() {
Expand Down Expand Up @@ -338,8 +338,8 @@ fzf-completion() {
if [ ${#tokens} -gt 1 -a "$tail" = "$trigger" ]; then
d_cmds=(${=FZF_COMPLETION_DIR_COMMANDS-cd pushd rmdir})

# Move the cursor before the trigger to maintain word array elements when
# trigger characters like ';' or '`' reset the array.
# Move the cursor before the trigger to preserve word array elements when
# characters like ';' or '`' would otherwise reset the 'words' array.
cursor_pos=$CURSOR
CURSOR=$((cursor_pos - ${#trigger} - 1))
# Make the 'cmd_word' global
Expand Down

0 comments on commit 4024a29

Please sign in to comment.