Skip to content

Commit 7567ff6

Browse files
author
Bhavi Dhingra
committed
refactor(gcommit): preview window no-hidden
1 parent e9180f1 commit 7567ff6

File tree

8 files changed

+10
-18
lines changed

8 files changed

+10
-18
lines changed

cmd/gbranchcreate

-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ function get_prefix() {
6666
--bind 'enter:print-query'\
6767
--header "${PREFIX_HEADER}"\
6868
--bind '?:toggle-preview'\
69-
--preview-window hidden\
7069
--preview "source $__CUSTOM_GIT_UTIL/fzf_previews/gbranchcreate/__prefix_preview;
7170
__prefix_preview")"
7271
echo "${prefix}"
@@ -82,7 +81,6 @@ function get_branch_type() {
8281
--info=hidden\
8382
--header "${TYPE_HEADER}"\
8483
--bind '?:toggle-preview'\
85-
--preview-window hidden\
8684
--preview "source $__CUSTOM_GIT_UTIL/fzf_previews/gbranchcreate/__type_preview;
8785
__type_preview {}")"
8886

@@ -98,7 +96,6 @@ function get_branch_name() {
9896
--bind 'enter:print-query'\
9997
--header "${NAME_HEADER}"\
10098
--bind '?:toggle-preview'\
101-
--preview-window hidden\
10299
--preview "source $__CUSTOM_GIT_UTIL/fzf_previews/gbranchcreate/__name_preview;
103100
__name_preview")"
104101
echo "${name}"

cmd/gcommit

-5
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,8 @@ function get_commit_type() {
107107

108108
local commitTypes=("feat" "fix" "perf" "refactor" "test" "style" "docs" "build" "ci" "cd")
109109

110-
local previewVisibility="nohidden"
111110
[ "${isBreakingChange}" == "false" ] && {
112111
commitTypes=("${commitTypes[@]}" "BREAKING-CHANGE")
113-
previewVisibility="hidden"
114112
}
115113

116114
local GCOMMIT_TYPE_HEADER="$(__type_header)"
@@ -120,7 +118,6 @@ function get_commit_type() {
120118
--info=hidden\
121119
--header "${GCOMMIT_TYPE_HEADER}"\
122120
--bind '?:toggle-preview'\
123-
--preview-window ${previewVisibility}\
124121
--preview "source $__CUSTOM_GIT_UTIL/fzf_previews/gcommit/__type_preview;
125122
__type_preview {} ${isBreakingChange}")"
126123

@@ -144,7 +141,6 @@ function get_commit_scope() {
144141
fzf --height=65% --preview-window :35%\
145142
--header "${GCOMMIT_SCOPE_HEADER}"\
146143
--bind '?:toggle-preview'\
147-
--preview-window hidden\
148144
--preview "source $__CUSTOM_GIT_UTIL/fzf_previews/gcommit/__scope_preview;
149145
__scope_preview ${isBreakingChange}")"
150146

@@ -188,7 +184,6 @@ function get_commit_description() {
188184
--bind 'enter:print-query'\
189185
--header "${GCOMMIT_DESCRIPTION_HEADER}"\
190186
--bind '?:toggle-preview'\
191-
--preview-window hidden\
192187
--preview "source $__CUSTOM_GIT_UTIL/fzf_previews/gcommit/__description_preview;
193188
__description_preview ${isBreakingChange}")"
194189
echo "${commitDescription}"

util/fzf_headers/gbranchcreate/__name_header

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ source "$__CUSTOM_CONSOLE_UTIL"/__common
88

99
function __name_header() {
1010

11-
local colorMsg="${BLUE}<?>:${RESET} help, ${BLUE}<esc>:${RESET} exit"
11+
local colorMsg="${BLUE}esc:${RESET} exit, ${BLUE}?:${RESET} toggle hint"
1212

1313
local edge="------------------------------------------"
1414
local NAME_HEADER="${edge}\n${colorMsg}\n "

util/fzf_headers/gbranchcreate/__prefix_header

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ source "$__CUSTOM_CONSOLE_UTIL"/__common
99
function __prefix_header() {
1010

1111
local colorMsg="Write a prefix\n\n"
12-
colorMsg="${colorMsg}${BLUE}<?>:${RESET} help, ${BLUE}<esc>:${RESET} skip prefix"
12+
colorMsg="${colorMsg}${BLUE}esc:${RESET} skip prefix, ${BLUE}?:${RESET} toggle hint"
1313

14-
local msg="<?>: help, <esc>: skip prefix"
14+
local msg="esc: skip prefix, ?: toggle hint"
1515
local edge="$(echo "${msg}" | sed "s/./-/g")"
1616
local GBRANCHCREATE_HEADER="${edge}\n${colorMsg}\n "
1717

util/fzf_headers/gbranchcreate/__type_header

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ source "$__CUSTOM_CONSOLE_UTIL"/__common
88

99
function __type_header() {
1010

11-
local colorMsg="${BLUE}<?>:${RESET} help, ${BLUE}<esc>:${RESET} skip branch type"
11+
local colorMsg="${BLUE}esc:${RESET} skip type, ${BLUE}?:${RESET} toggle hint"
1212

13-
local msg="<?>: help, <esc>: skip branch type"
13+
local msg="esc: skip type, ?: toggle hint"
1414
local edge="$(echo "${msg}" | sed "s/./-/g")"
1515
local TYPE_HEADER="${edge}\n${colorMsg}\n${edge}\n "
1616

util/fzf_headers/gcommit/__description_header

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ source "$__CUSTOM_CONSOLE_UTIL"/__common
99
function __description_header() {
1010

1111
local colorMsg="Write a short summary\n\n"
12-
colorMsg="${colorMsg}${BLUE}<?>:${RESET} help, ${BLUE}<esc>:${RESET} exit"
12+
colorMsg="${colorMsg}${BLUE}<?>:${RESET} toggle hint, ${BLUE}<esc>:${RESET} exit"
1313

1414
local edge="-----------------------------------------------------------------------------------"
1515
local GCOMMIT_DESCRIPTION_HEADER="${edge}\n${colorMsg}\n "

util/fzf_headers/gcommit/__scope_header

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ source "$__CUSTOM_CONSOLE_UTIL"/__common
88

99
function __scope_header() {
1010

11-
local colorMsg="${BLUE}<?>:${RESET} help, ${BLUE}<esc>:${RESET} skip scope"
11+
local colorMsg="${BLUE}<?>:${RESET} toggle hint, ${BLUE}<esc>:${RESET} skip scope"
1212

13-
local msg="<?>: help, <esc>: skip scope"
13+
local msg="<?>: toggle hint, <esc>: skip scope"
1414
local edge="$(echo "${msg}" | sed "s/./-/g")"
1515
local GCOMMIT_SCOPE_HEADER="${edge}\n${colorMsg}\n${edge}\n "
1616

util/fzf_headers/gcommit/__type_header

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ source "$__CUSTOM_CONSOLE_UTIL"/__common
99
function __type_header() {
1010

1111
local colorMsg="${MAGENTA}${UNDERLINE}gcommit${RESET} "
12-
colorMsg="${colorMsg}${BLUE}<?>:${RESET} help, ${BLUE}<esc>:${RESET} exit"
12+
colorMsg="${colorMsg}${BLUE}<?>:${RESET} toggle hint, ${BLUE}<esc>:${RESET} exit"
1313

14-
local msg="gcommit <?>: help, <esc>: exit"
14+
local msg="gcommit <?>: toggle hint, <esc>: exit"
1515
local edge="$(echo "${msg}" | sed "s/./-/g")"
1616
local GCOMMIT_TYPE_HEADER="${edge}\n${colorMsg}\n${edge}\n "
1717

0 commit comments

Comments
 (0)