(chore): optimize fzf popup

This commit is contained in:
Eduard Tolosa 2025-06-05 00:18:38 -05:00
parent d7c44fae63
commit 6ed4d3a32d

View file

@ -1,12 +1,9 @@
function __based_fzf_popup
set -l suggestions (__based)
if test (count $suggestions) -gt 0
set -l chosen (printf "%s\n" $suggestions | fzf --height 40% --reverse --prompt='Context > ' --query="$prefix" --no-sort --exact --border)
set -l chosen (printf "%s\n" (__based) | fzf --height 50% --reverse --prompt='Command > ' --no-sort --exact --border)
if test -n "$chosen"
set -l cleaned (string trim -- $chosen)
if test -n "$cleaned"
commandline -r -- "$cleaned"
if test -n "$chosen"
commandline -r -- "$chosen"
commandline -f repaint
# If BASED_NO_CONFIRMATION is set to a non-zero value, execute the command immediately
if set -q BASED_NO_CONFIRMATION; and test "$BASED_NO_CONFIRMATION" != 0
@ -17,5 +14,5 @@ function __based_fzf_popup
commandline -f repaint
return
end
end
end