Skip to content

Commit eedb9bc

Browse files
committed
better name and also hide log commit header
1 parent 90d2bfe commit eedb9bc

File tree

12 files changed

+24
-19
lines changed

12 files changed

+24
-19
lines changed

lib/core.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ is_vertical() {
4747
run_bc_program "__WIDTH__ / __HEIGHT__ < $GF_VERTICAL_THRESHOLD"
4848
}
4949

50-
should_hide_header() {
50+
particularly_small_screen() {
5151
if [ "$(is_vertical)" = '1' ]; then
52-
run_bc_program "$GF_VERTICAL_HIDE_HELP_CALCULATION"
52+
run_bc_program "$GF_VERTICAL_SMALL_SCREEN_CALCULATION"
5353
else
54-
run_bc_program "$GF_HORIZONTAL_HIDE_HELP_CALCULATION"
54+
run_bc_program "$GF_HORIZONTAL_SMALL_SCREEN_CALCULATION"
5555
fi
5656
}
5757

lib/load-configs.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ if [ -z "$GF_HORIZONTAL_PREVIEW_PERCENT_CALCULATION" ]; then
1818
export GF_HORIZONTAL_PREVIEW_PERCENT_CALCULATION='max(50, min(80, 100 - ((7000 + (11 * __WIDTH__)) / __WIDTH__)))'
1919
fi
2020

21-
if [ -z "$GF_HORIZONTAL_HIDE_HELP_CALCULATION" ]; then
22-
export GF_HORIZONTAL_HIDE_HELP_CALCULATION='__HEIGHT__ <= 30'
21+
if [ -z "$GF_HORIZONTAL_SMALL_SCREEN_CALCULATION" ]; then
22+
export GF_HORIZONTAL_SMALL_SCREEN_CALCULATION='__HEIGHT__ <= 30'
2323
fi
2424

2525
if [ -z "$GF_VERTICAL_PREVIEW_PERCENT_CALCULATION" ]; then
2626
export GF_VERTICAL_PREVIEW_PERCENT_CALCULATION='max(50, min(80, 100 - ((4000 + (5 * __HEIGHT__)) / __HEIGHT__)))'
2727
fi
2828

29-
if [ -z "$GF_VERTICAL_HIDE_HELP_CALCULATION" ]; then
30-
export GF_VERTICAL_HIDE_HELP_CALCULATION='__HEIGHT__ <= 60'
29+
if [ -z "$GF_VERTICAL_SMALL_SCREEN_CALCULATION" ]; then
30+
export GF_VERTICAL_SMALL_SCREEN_CALCULATION='__HEIGHT__ <= 60'
3131
fi
3232

3333
# -- Configuring External Command Style: --

lib/modules/branch.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ BRANCH_HEADER="$BRANCH_HEADER"'
3737
3838
'
3939

40-
if [ "$(should_hide_header)" = '1' ]; then
40+
if [ "$(particularly_small_screen)" = '1' ]; then
4141
BRANCH_HEADER=''
4242
fi
4343

lib/modules/diff-checkout.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ GF_DIFF_CHECKOUT_HEADER='
99
1010
'
1111

12-
if [ "$(should_hide_header)" = '1' ]; then
12+
if [ "$(particularly_small_screen)" = '1' ]; then
1313
GF_DIFF_CHECKOUT_HEADER=''
1414
fi
1515

lib/modules/diff-direct.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ GF_DIFF_DIRECT_HEADER='
66
77
'
88

9-
if [ "$(should_hide_header)" = '1' ]; then
9+
if [ "$(particularly_small_screen)" = '1' ]; then
1010
GF_DIFF_DIRECT_HEADER=''
1111
fi
1212

lib/modules/diff.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Type to filter. '"${WHITE}Enter${NORMAL} to ${GREEN}ACCEPT${NORMAL}."'
88
99
'
1010

11-
if [ "$(should_hide_header)" = '1' ]; then
11+
if [ "$(particularly_small_screen)" = '1' ]; then
1212
GF_DIFF_HEADER=''
1313
fi
1414

lib/modules/helpers/log.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,14 @@ gf_helper_log_preview_content() {
3131
if [ -n "$REF" ]; then
3232
QUERY="$(git fuzzy helper log_diff_query "$2")"
3333

34-
# NB: `fold` is not aware of color codes; however, folding over whitespace seems fine
35-
gf_git_command show --decorate --no-patch "$REF" | fold -s -w "$FZF_PREVIEW_COLUMNS"
36-
echo
34+
if [ "$(particularly_small_screen)" = '1' ]; then
35+
# NB: `fold` is not aware of color codes; however, folding over whitespace seems fine
36+
gf_git_command show --decorate --oneline --no-patch "$REF" | fold -s -w "$FZF_PREVIEW_COLUMNS"
37+
else
38+
# NB: `fold` is not aware of color codes; however, folding over whitespace seems fine
39+
gf_git_command show --decorate --no-patch "$REF" | fold -s -w "$FZF_PREVIEW_COLUMNS"
40+
echo
41+
fi
3742

3843
# shellcheck disable=2086
3944
gf_git_command_with_header_default_parameters 1 "$GF_DIFF_COMMIT_PREVIEW_DEFAULTS" diff "$REF^" "$REF" $QUERY | gf_diff_renderer

lib/modules/hub/pr.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ GF_PR_HEADER='
88
99
'
1010

11-
if [ "$(should_hide_header)" = '1' ]; then
11+
if [ "$(particularly_small_screen)" = '1' ]; then
1212
GF_PR_HEADER=''
1313
fi
1414

lib/modules/log.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Use '"${YELLOW}|${NORMAL} to separate CLI args for ${MAGENTA}git log${NORMAL} vs
1414
1515
'
1616

17-
if [ "$(should_hide_header)" = '1' ]; then
17+
if [ "$(particularly_small_screen)" = '1' ]; then
1818
GF_LOG_HEADER=''
1919
fi
2020

lib/modules/reflog.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Use '"${YELLOW}|${NORMAL} to separate CLI args for ${MAGENTA}git reflog${NORMAL}
1414
1515
'
1616

17-
if [ "$(should_hide_header)" = '1' ]; then
17+
if [ "$(particularly_small_screen)" = '1' ]; then
1818
GF_REFLOG_HEADER=''
1919
fi
2020

lib/modules/stash.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ GF_STASH_HEADER='
1414
1515
'
1616

17-
if [ "$(should_hide_header)" = '1' ]; then
17+
if [ "$(particularly_small_screen)" = '1' ]; then
1818
GF_STASH_HEADER=''
1919
fi
2020

lib/modules/status.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Type to filter. '"${WHITE}Enter${NORMAL} to ${GREEN}ACCEPT${NORMAL}"'
1717
1818
'
1919

20-
if [ "$(should_hide_header)" = '1' ]; then
20+
if [ "$(particularly_small_screen)" = '1' ]; then
2121
GF_STATUS_HEADER=''
2222
fi
2323

0 commit comments

Comments
 (0)