diff options
author | Richard Quirk <richard.quirk@gmail.com> | 2008-06-20 18:58:15 +0400 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2008-06-21 07:19:52 +0400 |
commit | cead78edef6a2f1339f699cd7d656b6834707b94 (patch) | |
tree | db27c7cea89af43aef2884cb797ea9bae35208e8 | |
parent | 8a965b8ee28bedc58641453e13d03f80180320dd (diff) |
git-gui: Fix accidental staged state toggle when clicking top pixel row
If a text widget is asked the index at x,y with y == 0 or y == 1 it will
always return 1.0 as the nearest index, regardless of the x position.
This means that clicking the top 2 pixels of the Unstaged/Staged Changes
lists caused the state of the file there to be toggled. This patch
checks that the pixel clicked is greater than 1, so there is less chance
of accidentally staging or unstaging changes.
Signed-off-by: Richard Quirk <richard.quirk@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rwxr-xr-x | git-gui.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/git-gui.sh b/git-gui.sh index 23d7dfec79..980dc0b373 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -1797,7 +1797,7 @@ proc toggle_or_diff {w x y} { $ui_index tag remove in_sel 0.0 end $ui_workdir tag remove in_sel 0.0 end - if {$col == 0} { + if {$col == 0 && $y > 1} { set i [expr {$lno-1}] set ll [expr {[llength $file_lists($w)]-1}] |