From e96974f34aeeef11459a77a5343efae4012f4983 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 12 May 2025 21:02:02 +0300 Subject: update quickedit --- dotfiles/fish/conf.d/quickedit.fish | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/dotfiles/fish/conf.d/quickedit.fish b/dotfiles/fish/conf.d/quickedit.fish index 73d58a8..dca7220 100644 --- a/dotfiles/fish/conf.d/quickedit.fish +++ b/dotfiles/fish/conf.d/quickedit.fish @@ -36,15 +36,17 @@ function quickedit end cd $QUICKEDIT_DIR - find -L . -type f \ - -not -path '*/.*' \ - | grep -E "$grep_pattern" \ - set -l file_path ( - find -L . -type f \ - -not -path '*/.*' \ - | grep -E "$grep_pattern" \ - | fzf - ) + set files (find -L . -type f -not -path '*/.*' | grep -E "$grep_pattern") + + switch (count $files) + case 0 + echo No result found + return + case 1 + set file_path $files[1] + case '*' + set file_path (printf '%s\n' $files | fzf) + end if editor::helix::open_with_lock $file_path quickedit::postaction $file_path -- cgit v1.2.3