From a215621eb92905c27c857e7e9f6b04d15e2eebaa Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 16 Feb 2016 16:42:06 +0100 Subject: [PATCH] gitk: fix arrow keys in input fields with Tcl/Tk >= 8.6 Tcl/Tk 8.6 introduced new events for the cursor left/right keys and apparently changed the behavior of the previous event. Let's work around that by using the new events when we are running with Tcl/Tk 8.6 or later. This fixes https://github.com/git-for-windows/git/issues/495 Signed-off-by: Johannes Schindelin --- gitk-git/gitk | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gitk-git/gitk b/gitk-git/gitk index 6b84ee13273e4a..980e3e1b83f8ea 100755 --- a/gitk-git/gitk +++ b/gitk-git/gitk @@ -2234,7 +2234,7 @@ proc makewindow {} { global headctxmenu progresscanv progressitem progresscoords statusw global fprogitem fprogcoord lastprogupdate progupdatepending global rprogitem rprogcoord rownumsel numcommits - global have_tk85 use_ttk NS + global have_tk85 have_tk86 use_ttk NS global git_version global worddiff @@ -2732,8 +2732,13 @@ proc makewindow {} { bind . "selnextline 1" bind . "dofind -1 0" bind . "dofind 1 0" - bindkey "goforw" - bindkey "goback" + if {$have_tk86} { + bindkey <> "goforw" + bindkey <> "goback" + } else { + bindkey "goforw" + bindkey "goback" + } bind . "selnextpage -1" bind . "selnextpage 1" bind . <$M1B-Home> "allcanvs yview moveto 0.0" @@ -12734,6 +12739,7 @@ set nullid2 "0000000000000000000000000000000000000001" set nullfile "/dev/null" set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}] +set have_tk86 [expr {[package vcompare $tk_version "8.6"] >= 0}] if {![info exists have_ttk]} { set have_ttk [llength [info commands ::ttk::style]] }