]> granicus.if.org Git - git/commitdiff
git-gui: ensure the file in the diff pane is in the list of selected files
authorAlex Riesen <alexander.riesen@cetitec.com>
Tue, 28 Jun 2016 08:59:25 +0000 (10:59 +0200)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Mon, 3 Oct 2016 22:27:14 +0000 (23:27 +0100)
It is very confusing that the file which diff is displayed is marked as
selected, but it is not in fact selected (that means the array of selected
files does not include the file in question).

Fixing this also improves the use of $FILENAMES in custom defined tools: one
does not have to click the file in the list to make it selected.

Signed-off-by: Alex Riesen <alexander.riesen@cetitec.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
lib/diff.tcl

index 0d569862156d9e984f3c04f5662880148f92bc21..30bdd691ee0447a0498e0ec06c1bcaa3379c2d3c 100644 (file)
@@ -127,6 +127,9 @@ proc show_diff {path w {lno {}} {scroll_pos {}} {callback {}}} {
        } else {
                start_show_diff $cont_info
        }
+
+       global current_diff_path selected_paths
+       set selected_paths($current_diff_path) 1
 }
 
 proc show_unmerged_diff {cont_info} {