diff options
| author | Shawn O. Pearce <spearce@spearce.org> | 2007-01-20 23:46:53 -0500 |
|---|---|---|
| committer | Shawn O. Pearce <spearce@spearce.org> | 2007-01-21 02:54:24 -0500 |
| commit | 833eda736ad1ec99c30b2c4d7a565ccc406c97a0 (patch) | |
| tree | 098385d23f75231b3da77b232d6537d244b41425 | |
| parent | 31a8d1968ed12c0b98c1c34d789a66f54ecbbc13 (diff) | |
| download | git-833eda736ad1ec99c30b2c4d7a565ccc406c97a0.tar.xz | |
git-gui: Only permit selection in one list at a time.
Now that our lists represent more defined states it no longer makes any
sense to permit a user to make selections from both lists at once, as
the each available operation acts only on files whose status corresponds
to only one of the lists.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| -rwxr-xr-x | git-gui.sh | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/git-gui.sh b/git-gui.sh index 984535687c..a1002ecab8 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -1355,7 +1355,7 @@ proc display_all_files_helper {w path icon_name m} { proc display_all_files {} { global ui_index ui_workdir global file_states file_lists - global last_clicked selected_paths + global last_clicked $ui_index conf -state normal $ui_workdir conf -state normal @@ -2852,18 +2852,21 @@ proc toggle_or_diff {w x y} { } proc add_one_to_selection {w x y} { - global file_lists - global last_clicked selected_paths + global file_lists last_clicked selected_paths - set pos [split [$w index @$x,$y] .] - set lno [lindex $pos 0] - set col [lindex $pos 1] + set lno [lindex [split [$w index @$x,$y] .] 0] set path [lindex $file_lists($w) [expr {$lno - 1}]] if {$path eq {}} { set last_clicked {} return } + if {$last_clicked ne {} + && [lindex $last_clicked 0] ne $w} { + array unset selected_paths + [lindex $last_clicked 0] tag remove in_sel 0.0 end + } + set last_clicked [list $w $lno] if {[catch {set in_sel $selected_paths($path)}]} { set in_sel 0 @@ -2878,16 +2881,14 @@ proc add_one_to_selection {w x y} { } proc add_range_to_selection {w x y} { - global file_lists - global last_clicked selected_paths + global file_lists last_clicked selected_paths if {[lindex $last_clicked 0] ne $w} { toggle_or_diff $w $x $y return } - set pos [split [$w index @$x,$y] .] - set lno [lindex $pos 0] + set lno [lindex [split [$w index @$x,$y] .] 0] set lc [lindex $last_clicked 1] if {$lc < $lno} { set begin $lc |
