Skip to content

Commit 75e78c8

Browse files
committed
git-gui: Fix 'Select All' action on Windows.
Sometimes the Select All action from our context menus doesn't work unless the text field its supposed to act on has focus. I'm not really sure why adding the sel tag requires having focus. It technically should not be required to update the sel tag membership, but perhaps there is a bug in Tcl/Tk 8.4.1 on Windows which is causing this odd behavior. Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent e0c781b commit 75e78c8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

git-gui.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2539,7 +2539,7 @@ proc console_init {w} {
25392539
-command "tk_textCopy $w.m.t"
25402540
$w.ctxm add command -label "Select All" \
25412541
-font font_ui \
2542-
-command "$w.m.t tag add sel 0.0 end"
2542+
-command "focus $w.m.t;$w.m.t tag add sel 0.0 end"
25432543
$w.ctxm add command -label "Copy All" \
25442544
-font font_ui \
25452545
-command "
@@ -3913,7 +3913,7 @@ $ctxm add separator
39133913
$ctxm add command \
39143914
-label {Select All} \
39153915
-font font_ui \
3916-
-command {$ui_comm tag add sel 0.0 end}
3916+
-command {focus $ui_comm;$ui_comm tag add sel 0.0 end}
39173917
$ctxm add command \
39183918
-label {Copy All} \
39193919
-font font_ui \
@@ -4059,7 +4059,7 @@ lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
40594059
$ctxm add command \
40604060
-label {Select All} \
40614061
-font font_ui \
4062-
-command {$ui_diff tag add sel 0.0 end}
4062+
-command {focus $ui_diff;$ui_diff tag add sel 0.0 end}
40634063
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
40644064
$ctxm add command \
40654065
-label {Copy All} \

0 commit comments

Comments
 (0)