@@ -2079,7 +2079,7 @@ proc makewindow {} {
20792079 global headctxmenu progresscanv progressitem progresscoords statusw
20802080 global fprogitem fprogcoord lastprogupdate progupdatepending
20812081 global rprogitem rprogcoord rownumsel numcommits
2082- global have_tk85 use_ttk NS
2082+ global have_tk85 have_tk86 use_ttk NS
20832083 global git_version
20842084 global worddiff
20852085
@@ -2577,8 +2577,13 @@ proc makewindow {} {
25772577 bind . <Key-Down> " selnextline 1"
25782578 bind . <Shift-Key-Up> " dofind -1 0"
25792579 bind . <Shift-Key-Down> " dofind 1 0"
2580- bindkey <Key-Right> " goforw"
2581- bindkey <Key-Left> " goback"
2580+ if {$have_tk86 } {
2581+ bindkey <<NextChar>> " goforw"
2582+ bindkey <<PrevChar>> " goback"
2583+ } else {
2584+ bindkey <Key-Right> " goforw"
2585+ bindkey <Key-Left> " goback"
2586+ }
25822587 bind . <Key-Prior> " selnextpage -1"
25832588 bind . <Key-Next> " selnextpage 1"
25842589 bind . <$M1B -Home> " allcanvs yview moveto 0.0"
@@ -7692,7 +7697,7 @@ proc gettreeline {gtf id} {
76927697 if {[string index $fname 0] eq " \" " } {
76937698 set fname [lindex $fname 0]
76947699 }
7695- set fname [encoding convertfrom $fname ]
7700+ set fname [encoding convertfrom utf-8 $fname ]
76967701 lappend treefilelist($id ) $fname
76977702 }
76987703 if {![eof $gtf ]} {
@@ -7954,7 +7959,7 @@ proc gettreediffline {gdtf ids} {
79547959 if {[string index $file 0] eq " \" " } {
79557960 set file [lindex $file 0]
79567961 }
7957- set file [encoding convertfrom $file ]
7962+ set file [encoding convertfrom utf-8 $file ]
79587963 if {$file ne [lindex $treediff end]} {
79597964 lappend treediff $file
79607965 lappend sublist $file
@@ -8099,7 +8104,7 @@ proc makediffhdr {fname ids} {
80998104 global ctext curdiffstart treediffs diffencoding
81008105 global ctext_file_names jump_to_here targetline diffline
81018106
8102- set fname [encoding convertfrom $fname ]
8107+ set fname [encoding convertfrom utf-8 $fname ]
81038108 set diffencoding [get_path_encoding $fname ]
81048109 set i [lsearch -exact $treediffs($ids) $fname ]
81058110 if {$i >= 0} {
@@ -8161,7 +8166,7 @@ proc parseblobdiffline {ids line} {
81618166
81628167 if {![string compare -length 5 " diff " $line ]} {
81638168 if {![regexp {^diff (--cc|--git) } $line m type]} {
8164- set line [encoding convertfrom $line ]
8169+ set line [encoding convertfrom utf-8 $line ]
81658170 $ctext insert end " $line \n " hunksep
81668171 continue
81678172 }
@@ -8210,7 +8215,7 @@ proc parseblobdiffline {ids line} {
82108215 makediffhdr $fname $ids
82118216
82128217 } elseif {![string compare -length 16 " * Unmerged path " $line ]} {
8213- set fname [encoding convertfrom [string range $line 16 end]]
8218+ set fname [encoding convertfrom utf-8 [string range $line 16 end]]
82148219 $ctext insert end " \n "
82158220 set curdiffstart [$ctext index " end - 1c" ]
82168221 lappend ctext_file_names $fname
@@ -8263,7 +8268,7 @@ proc parseblobdiffline {ids line} {
82638268 if {[string index $fname 0] eq " \" " } {
82648269 set fname [lindex $fname 0]
82658270 }
8266- set fname [encoding convertfrom $fname ]
8271+ set fname [encoding convertfrom utf-8 $fname ]
82678272 set i [lsearch -exact $treediffs($ids) $fname ]
82688273 if {$i >= 0} {
82698274 setinlist difffilestart $i $curdiffstart
@@ -8282,6 +8287,7 @@ proc parseblobdiffline {ids line} {
82828287 set diffinhdr 0
82838288 return
82848289 }
8290+ set line [encoding convertfrom utf-8 $line ]
82858291 $ctext insert end " $line \n " filesep
82868292
82878293 } else {
@@ -10040,7 +10046,7 @@ proc showrefs {} {
1004010046 text $top .list -background $bgcolor -foreground $fgcolor \
1004110047 -selectbackground $selectbgcolor -font mainfont \
1004210048 -xscrollcommand " $top .xsb set" -yscrollcommand " $top .ysb set" \
10043- -width 30 -height 20 -cursor $maincursor \
10049+ -width 60 -height 20 -cursor $maincursor \
1004410050 -spacing1 1 -spacing3 1 -state disabled
1004510051 $top .list tag configure highlight -background $selectbgcolor
1004610052 if {![lsearch -exact $bglist $top .list]} {
@@ -12244,7 +12250,7 @@ proc cache_gitattr {attr pathlist} {
1224412250 foreach row [split $rlist " \n " ] {
1224512251 if {[regexp "(.*): $attr : (.*)" $row m path value]} {
1224612252 if {[string index $path 0] eq " \" " } {
12247- set path [encoding convertfrom [lindex $path 0]]
12253+ set path [encoding convertfrom utf-8 [lindex $path 0]]
1224812254 }
1224912255 set path_attr_cache($attr ,$path ) $value
1225012256 }
@@ -12274,7 +12280,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
1227412280 set gitk_prefix [file dirname [file dirname [file normalize $argv0 ]]]
1227512281 set gitk_libdir [file join $gitk_prefix share gitk lib]
1227612282 set gitk_msgsdir [file join $gitk_libdir msgs]
12277- unset gitk_prefix
1227812283}
1227912284
1228012285# # Internationalization (i18n) through msgcat and gettext. See
@@ -12573,6 +12578,7 @@ set nullid2 "0000000000000000000000000000000000000001"
1257312578set nullfile " /dev/null"
1257412579
1257512580set have_tk85 [expr {[package vcompare $tk_version " 8.5" ] >= 0}]
12581+ set have_tk86 [expr {[package vcompare $tk_version " 8.6" ] >= 0}]
1257612582if {![info exists have_ttk]} {
1257712583 set have_ttk [llength [info commands ::ttk::style]]
1257812584}
@@ -12637,28 +12643,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
1263712643set worktree [gitworktree]
1263812644setcoords
1263912645makewindow
12640- catch {
12641- image create photo gitlogo -width 16 -height 16
12642-
12643- image create photo gitlogominus -width 4 -height 2
12644- gitlogominus put #C00000 -to 0 0 4 2
12645- gitlogo copy gitlogominus -to 1 5
12646- gitlogo copy gitlogominus -to 6 5
12647- gitlogo copy gitlogominus -to 11 5
12648- image delete gitlogominus
12649-
12650- image create photo gitlogoplus -width 4 -height 4
12651- gitlogoplus put #008000 -to 1 0 3 4
12652- gitlogoplus put #008000 -to 0 1 4 3
12653- gitlogo copy gitlogoplus -to 1 9
12654- gitlogo copy gitlogoplus -to 6 9
12655- gitlogo copy gitlogoplus -to 11 9
12656- image delete gitlogoplus
12657-
12658- image create photo gitlogo32 -width 32 -height 32
12659- gitlogo32 copy gitlogo -zoom 2 2
12660-
12661- wm iconphoto . -default gitlogo gitlogo32
12646+ if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix /etc/git.ico]} {
12647+ wm iconbitmap . -default $gitk_prefix /etc/git.ico
12648+ } else {
12649+ catch {
12650+ image create photo gitlogo -width 16 -height 16
12651+
12652+ image create photo gitlogominus -width 4 -height 2
12653+ gitlogominus put #C00000 -to 0 0 4 2
12654+ gitlogo copy gitlogominus -to 1 5
12655+ gitlogo copy gitlogominus -to 6 5
12656+ gitlogo copy gitlogominus -to 11 5
12657+ image delete gitlogominus
12658+
12659+ image create photo gitlogoplus -width 4 -height 4
12660+ gitlogoplus put #008000 -to 1 0 3 4
12661+ gitlogoplus put #008000 -to 0 1 4 3
12662+ gitlogo copy gitlogoplus -to 1 9
12663+ gitlogo copy gitlogoplus -to 6 9
12664+ gitlogo copy gitlogoplus -to 11 9
12665+ image delete gitlogoplus
12666+
12667+ image create photo gitlogo32 -width 32 -height 32
12668+ gitlogo32 copy gitlogo -zoom 2 2
12669+
12670+ wm iconphoto . -default gitlogo gitlogo32
12671+ }
1266212672}
1266312673# wait for the window to become visible
1266412674tkwait visibility .
0 commit comments