From b4715509bbc81cf14305de189dc65c047a873608 Mon Sep 17 00:00:00 2001 From: Damien Dart Date: Thu, 25 Jul 2024 23:56:36 +0100 Subject: [PATCH] Tweak the height of various fuzzy finders. --- bin/fuzzy-grep | 6 +++--- bin/fuzzy-snippets | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/fuzzy-grep b/bin/fuzzy-grep index 9b1bdf7..07522b1 100755 --- a/bin/fuzzy-grep +++ b/bin/fuzzy-grep @@ -103,6 +103,7 @@ while :; do done FZF_EXPECT='f1' +FZF_HEIGHT='20' INITIAL_QUERY="${*:-}" # shellcheck disable=SC2016 @@ -137,6 +138,7 @@ PROMPT_TRANSFORM=' if [ "$VIM_MODE" = 1 ]; then FZF_EXPECT='ctrl-t,ctrl-v,ctrl-x,f1' + FZF_HEIGHT='100%' fi case "$(git rev-parse --is-inside-work-tree 2>/dev/null)" in @@ -174,9 +176,9 @@ FZF_OUTPUT=$(\ --disabled \ --delimiter=':' \ --expect="$FZF_EXPECT" \ + --height="$FZF_HEIGHT" \ --info='inline-right' \ --multi \ - --no-clear \ --preview='(nl -ba {1} | grep --color=always -E "$(printf "|^\s*%s\s.*" {2})") 2>/dev/null' \ --preview-window='+{2}/3,<80(down)' \ --prompt="($(pathshorten)) " \ @@ -191,7 +193,6 @@ case $SELECTED_ACTION in if [ "$VIM_MODE" = 1 ]; then echo "$SELECTED_ACTION" else - tput rmcup help fi @@ -204,7 +205,6 @@ if [ "$FZF_STATUS" != 0 ]; then # 1, signalling that no matches were made, or 130, signalling that it # was aborted or interrupted by the user. if [ "$FZF_STATUS" = 1 ] || [ "$FZF_STATUS" = 130 ]; then - tput rmcup exit else exit $FZF_STATUS diff --git a/bin/fuzzy-snippets b/bin/fuzzy-snippets index da8cfa5..fc2ea40 100755 --- a/bin/fuzzy-snippets +++ b/bin/fuzzy-snippets @@ -135,12 +135,14 @@ if [ "$LIST_FILES" = 1 ]; then fi FZF_EXPECT='ctrl-p,f1' +FZF_HEIGHT='20' FZF_LABEL='ENTER: Copy snippet ╱ CTRL+P: Print snippet ╱ F1: Help' IFS=' ' INITIAL_QUERY="${*:-}" if [ "$VIM_MODE" = 1 ]; then FZF_EXPECT='ctrl-y,f1' + FZF_HEIGHT='100%' FZF_LABEL='ENTER: insert ╱ CTRL+Y: yank ╱ F1: help' fi @@ -158,6 +160,7 @@ FZF_OUTPUT=$(\ --border-label-pos='-3:bottom' \ --delimiter='/' \ --expect="$FZF_EXPECT" \ + --height="$FZF_HEIGHT" \ --info='inline-right' \ --preview='cat {} 2>/dev/null' \ --preview-window='<80(down)' \