summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-08-19 18:38:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-08-19 18:38:15 (GMT)
commit63f328290a0edda617c0881a356c07280fbba459 (patch)
treee641651dfe5a9eedcf4ad9968f7ebac7585651a5
parentf16eb1f6a3f9a1a09a61f0cd07e9c9ff9ee54530 (diff)
parent51b8c5021a19195e0f138832b081a356a2247bca (diff)
downloadgit-63f328290a0edda617c0881a356c07280fbba459.zip
git-63f328290a0edda617c0881a356c07280fbba459.tar.gz
git-63f328290a0edda617c0881a356c07280fbba459.tar.bz2
Merge branch 'master' of git://repo.or.cz/git-gui
* 'master' of git://repo.or.cz/git-gui: git-gui: Added support for OS X right click git-gui: Avoid Tcl error in popup menu on diff viewer
-rwxr-xr-xgit-gui/git-gui.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 671b887..29a790e 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -1348,6 +1348,9 @@ unset i
proc bind_button3 {w cmd} {
bind $w <Any-Button-3> $cmd
if {[is_MacOSX]} {
+ # Mac OS X sends Button-2 on right click through three-button mouse,
+ # or through trackpad right-clicking (two-finger touch + click).
+ bind $w <Any-Button-2> $cmd
bind $w <Control-Button-1> $cmd
}
}
@@ -2407,13 +2410,15 @@ $ctxm add separator
$ctxm add command -label {Options...} \
-command do_options
proc popup_diff_menu {ctxm x y X Y} {
+ global current_diff_path
set ::cursorX $x
set ::cursorY $y
if {$::ui_index eq $::current_diff_side} {
$ctxm entryconf $::ui_diff_applyhunk \
-state normal \
-label {Unstage Hunk From Commit}
- } elseif {{_O} eq [lindex $::file_states($::current_diff_path) 0]} {
+ } elseif {![info exists file_states($current_diff_path)]
+ || {_O} eq [lindex $file_states($::current_diff_path) 0]} {
$ctxm entryconf $::ui_diff_applyhunk \
-state disabled \
-label {Stage Hunk For Commit}