Skip to content

Commit

Permalink
"fuzzy-grep": Improve handling of empty queries.
Browse files Browse the repository at this point in the history
  • Loading branch information
damiendart committed Jul 18, 2024
1 parent 7581820 commit 442c1af
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions bin/fuzzy-grep
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,18 @@ INITIAL_QUERY="${*:-}"
export INPUT_TRANSFORM='
RELOAD_BASE="reload:rg --color=always --column --hidden --line-number --smart-case %s -- \{q} || true"
case "$FZF_PROMPT" in
*★*)
printf "$RELOAD_BASE" "--no-ignore"
;;
*)
printf "$RELOAD_BASE" "--glob=\"!.git/\""
;;
esac
if [[ "$FZF_QUERY" == "" ]]; then
echo "reload:true"
else
case "$FZF_PROMPT" in
*★*)
printf "$RELOAD_BASE" "--no-ignore"
;;
*)
printf "$RELOAD_BASE" "--glob=\"!.git/\""
;;
esac
fi
'

# shellcheck disable=SC2016
Expand Down

0 comments on commit 442c1af

Please sign in to comment.