From aa00038f28534bd45cb463b8bdfdafbc51331157 Mon Sep 17 00:00:00 2001 From: Eduard Tolosa Date: Thu, 28 Aug 2025 16:27:22 -0500 Subject: [PATCH] (chore): better repaint handling --- functions/__based_fzf_popup.fish | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/functions/__based_fzf_popup.fish b/functions/__based_fzf_popup.fish index da8f869..3c2bd01 100644 --- a/functions/__based_fzf_popup.fish +++ b/functions/__based_fzf_popup.fish @@ -12,13 +12,18 @@ function __based_fzf_popup if test -n "$chosen" commandline -r -- "$chosen" + # Prevent autocomplete samples from remaining before the selected command. + # i.e: if you run `cd`, then arrow up, and select a command, the initial `cd` will be + # visible before the selected command, like: `cd cd `. It doesn't affect functionality, + # but it can be visually confusing. commandline -f repaint # Only execute if the user pressed ENTER and confirmation is set if test "$key" = enter; and set -q BASED_NO_CONFIRMATION; and test "$BASED_NO_CONFIRMATION" != 0 commandline -f execute end - else - commandline -f repaint end + + # Update the display for commands like directory changes + commandline -f repaint end