Skip to content

Commit

Permalink
git-gui: Avoid using the <<Copy>> binding as a menu accelerator on win32
Browse files Browse the repository at this point in the history
On Windows the Control-C binding is used to copy and is mapped to the Tk
virtual event <<Copy>>. In the initial git-gui dialog this is also bound
as an accelerator for the Clone menu item. The effect is that both bindings
run, copying the text but resetting the clone page or switching to the clone
page when the user tries to copy text from one of the entry fields.
This patch avoids this by using Control-L instead for Windows only.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
  • Loading branch information
Pat Thoyts committed Jul 30, 2010
1 parent fc17e5e commit 8512354
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/choose_repository.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,17 @@ constructor pick {} {
$opts insert end [mc "Clone Existing Repository"] link_clone
$opts insert end "\n"
if {$m_repo ne {}} {
if {[tk windowingsystem] eq "win32"} {
set key L
} else {
set key C
}
$m_repo add command \
-command [cb _next clone] \
-accelerator $M1T-C \
-accelerator $M1T-$key \
-label [mc "Clone..."]
bind $top <$M1B-c> [cb _next clone]
bind $top <$M1B-C> [cb _next clone]
bind $top <$M1B-[string tolower $key]> [cb _next clone]
bind $top <$M1B-[string toupper $key]> [cb _next clone]
}

$opts tag conf link_open -foreground blue -underline 1
Expand Down

0 comments on commit 8512354

Please sign in to comment.