Skip to content

Commit

Permalink
fix: Do not append slashes when completing to a common prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenwierum committed Feb 20, 2024
1 parent 9d8cc16 commit 4b37ea7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fzf-tab.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@
-ftb-generate-query # sets `_ftb_query` and `_ftb_query_prefix`

local curr_prefix="${PREFIX##*/}"
if [[ "$complete_common_prefix" == true && $_ftb_query_prefix == 1 && "$curr_prefix" != "$_ftb_query"* ]]; then
if [[ "$complete_common_prefix" == true && $_ftb_query_prefix == 1 && "$curr_prefix" != "$_ftb_query"* ]]; then
local -A v=("${(@0)${_ftb_compcap[1]}}")
local -a args=("${(@ps:\1:)v[args]}")
[[ -z $args[1] ]] && args=() # don't pass an empty string
IPREFIX=$v[IPREFIX] PREFIX=$v[PREFIX] SUFFIX=$v[SUFFIX] ISUFFIX=$v[ISUFFIX]
builtin compadd "${args[@]:--Q}" -Q -- $_ftb_query
builtin compadd "${${(@)${(@)args:#-f}:#-W}[@]}" -- $_ftb_query

compstate[list]=
compstate[insert]=
Expand Down

0 comments on commit 4b37ea7

Please sign in to comment.