git-gui: allow Ctrl+T to toggle multiple paths
It is possible to select multiple files in the "Unstaged Changes" and the "Staged Changes" lists. But when hitting Ctrl+T, surprisingly only one entry is handled, not all selected ones. Let's just use the same code path as for the "Stage To Commit" and the "Unstage From Commit" menu items. This fixes https://github.com/git-for-windows/git/issues/1012 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Jan 9, 2018 at 15:33 UTC
76756d67061076c046973bff2089ad49f5dc2eb6
1 file changed
+13
git-gui.sh
+13
@@ -2502,6 +2502,19 @@ proc toggle_or_diff {mode w args} {
2502
set pos [split [$w index @$x,$y] .]
2503
foreach {lno col} $pos break
2504
} else {
2505
+ if {$mode eq "toggle"} {
2506
+ if {$w eq $ui_workdir} {
2507
+ do_add_selection
2508
+ set last_clicked {}
2509
+ return
2510
+ }
2511
+ if {$w eq $ui_index} {
2512
+ do_unstage_selection
2513
+ set last_clicked {}
2514
+ return
2515
+ }
2516
+ }
2517
+
2518
if {$last_clicked ne {}} {
2519
set lno [lindex $last_clicked 1]
2520
} else {