Skip to content

Commit f7a8834

Browse files
committed
Merge branch 'bp/amend-toggle-bind'
Toggle amend on and off with the keyboard shortcut "Ctrl+e". * bp/amend-toggle-bind: git-gui: add hotkey to toggle "Amend Last Commit"
2 parents 6c8ec8c + ec7424e commit f7a8834

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

git-gui.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2664,6 +2664,12 @@ proc focus_widget {widget} {
26642664
}
26652665
}
26662666
2667+
proc toggle_commit_type {} {
2668+
global commit_type_is_amend
2669+
set commit_type_is_amend [expr !$commit_type_is_amend]
2670+
do_select_commit_type
2671+
}
2672+
26672673
######################################################################
26682674
##
26692675
## ui construction
@@ -2854,6 +2860,7 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
28542860
if {![is_enabled nocommit]} {
28552861
.mbar.commit add checkbutton \
28562862
-label [mc "Amend Last Commit"] \
2863+
-accelerator $M1T-E \
28572864
-variable commit_type_is_amend \
28582865
-command do_select_commit_type
28592866
lappend disable_on_lock \
@@ -3898,6 +3905,8 @@ bind . <$M1B-Key-j> do_revert_selection
38983905
bind . <$M1B-Key-J> do_revert_selection
38993906
bind . <$M1B-Key-i> do_add_all
39003907
bind . <$M1B-Key-I> do_add_all
3908+
bind . <$M1B-Key-e> toggle_commit_type
3909+
bind . <$M1B-Key-E> toggle_commit_type
39013910
bind . <$M1B-Key-minus> {show_less_context;break}
39023911
bind . <$M1B-Key-KP_Subtract> {show_less_context;break}
39033912
bind . <$M1B-Key-equal> {show_more_context;break}

0 commit comments

Comments
 (0)