Skip to content

Commit 8512354

Browse files
committed
git-gui: Avoid using the <<Copy>> binding as a menu accelerator on win32
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 <[email protected]>
1 parent fc17e5e commit 8512354

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/choose_repository.tcl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,17 @@ constructor pick {} {
100100
$opts insert end [mc "Clone Existing Repository"] link_clone
101101
$opts insert end "\n"
102102
if {$m_repo ne {}} {
103+
if {[tk windowingsystem] eq "win32"} {
104+
set key L
105+
} else {
106+
set key C
107+
}
103108
$m_repo add command \
104109
-command [cb _next clone] \
105-
-accelerator $M1T-C \
110+
-accelerator $M1T-$key \
106111
-label [mc "Clone..."]
107-
bind $top <$M1B-c> [cb _next clone]
108-
bind $top <$M1B-C> [cb _next clone]
112+
bind $top <$M1B-[string tolower $key]> [cb _next clone]
113+
bind $top <$M1B-[string toupper $key]> [cb _next clone]
109114
}
110115

111116
$opts tag conf link_open -foreground blue -underline 1

0 commit comments

Comments
 (0)