@@ -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"
@@ -7689,7 +7694,7 @@ proc gettreeline {gtf id} {
76897694 if {[string index $fname 0] eq " \" " } {
76907695 set fname [lindex $fname 0]
76917696 }
7692- set fname [encoding convertfrom $fname ]
7697+ set fname [encoding convertfrom utf-8 $fname ]
76937698 lappend treefilelist($id ) $fname
76947699 }
76957700 if {![eof $gtf ]} {
@@ -7951,7 +7956,7 @@ proc gettreediffline {gdtf ids} {
79517956 if {[string index $file 0] eq " \" " } {
79527957 set file [lindex $file 0]
79537958 }
7954- set file [encoding convertfrom $file ]
7959+ set file [encoding convertfrom utf-8 $file ]
79557960 if {$file ne [lindex $treediff end]} {
79567961 lappend treediff $file
79577962 lappend sublist $file
@@ -8096,7 +8101,7 @@ proc makediffhdr {fname ids} {
80968101 global ctext curdiffstart treediffs diffencoding
80978102 global ctext_file_names jump_to_here targetline diffline
80988103
8099- set fname [encoding convertfrom $fname ]
8104+ set fname [encoding convertfrom utf-8 $fname ]
81008105 set diffencoding [get_path_encoding $fname ]
81018106 set i [lsearch -exact $treediffs($ids) $fname ]
81028107 if {$i >= 0} {
@@ -8158,7 +8163,7 @@ proc parseblobdiffline {ids line} {
81588163
81598164 if {![string compare -length 5 " diff " $line ]} {
81608165 if {![regexp {^diff (--cc|--git) } $line m type]} {
8161- set line [encoding convertfrom $line ]
8166+ set line [encoding convertfrom utf-8 $line ]
81628167 $ctext insert end " $line \n " hunksep
81638168 continue
81648169 }
@@ -8207,7 +8212,7 @@ proc parseblobdiffline {ids line} {
82078212 makediffhdr $fname $ids
82088213
82098214 } elseif {![string compare -length 16 " * Unmerged path " $line ]} {
8210- set fname [encoding convertfrom [string range $line 16 end]]
8215+ set fname [encoding convertfrom utf-8 [string range $line 16 end]]
82118216 $ctext insert end " \n "
82128217 set curdiffstart [$ctext index " end - 1c" ]
82138218 lappend ctext_file_names $fname
@@ -8260,7 +8265,7 @@ proc parseblobdiffline {ids line} {
82608265 if {[string index $fname 0] eq " \" " } {
82618266 set fname [lindex $fname 0]
82628267 }
8263- set fname [encoding convertfrom $fname ]
8268+ set fname [encoding convertfrom utf-8 $fname ]
82648269 set i [lsearch -exact $treediffs($ids) $fname ]
82658270 if {$i >= 0} {
82668271 setinlist difffilestart $i $curdiffstart
@@ -8279,6 +8284,7 @@ proc parseblobdiffline {ids line} {
82798284 set diffinhdr 0
82808285 return
82818286 }
8287+ set line [encoding convertfrom utf-8 $line ]
82828288 $ctext insert end " $line \n " filesep
82838289
82848290 } else {
@@ -10037,7 +10043,7 @@ proc showrefs {} {
1003710043 text $top .list -background $bgcolor -foreground $fgcolor \
1003810044 -selectbackground $selectbgcolor -font mainfont \
1003910045 -xscrollcommand " $top .xsb set" -yscrollcommand " $top .ysb set" \
10040- -width 30 -height 20 -cursor $maincursor \
10046+ -width 60 -height 20 -cursor $maincursor \
1004110047 -spacing1 1 -spacing3 1 -state disabled
1004210048 $top .list tag configure highlight -background $selectbgcolor
1004310049 if {![lsearch -exact $bglist $top .list]} {
@@ -12241,7 +12247,7 @@ proc cache_gitattr {attr pathlist} {
1224112247 foreach row [split $rlist " \n " ] {
1224212248 if {[regexp "(.*): $attr : (.*)" $row m path value]} {
1224312249 if {[string index $path 0] eq " \" " } {
12244- set path [encoding convertfrom [lindex $path 0]]
12250+ set path [encoding convertfrom utf-8 [lindex $path 0]]
1224512251 }
1224612252 set path_attr_cache($attr ,$path ) $value
1224712253 }
@@ -12271,7 +12277,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
1227112277 set gitk_prefix [file dirname [file dirname [file normalize $argv0 ]]]
1227212278 set gitk_libdir [file join $gitk_prefix share gitk lib]
1227312279 set gitk_msgsdir [file join $gitk_libdir msgs]
12274- unset gitk_prefix
1227512280}
1227612281
1227712282# # Internationalization (i18n) through msgcat and gettext. See
@@ -12570,6 +12575,7 @@ set nullid2 "0000000000000000000000000000000000000001"
1257012575set nullfile " /dev/null"
1257112576
1257212577set have_tk85 [expr {[package vcompare $tk_version " 8.5" ] >= 0}]
12578+ set have_tk86 [expr {[package vcompare $tk_version " 8.6" ] >= 0}]
1257312579if {![info exists have_ttk]} {
1257412580 set have_ttk [llength [info commands ::ttk::style]]
1257512581}
@@ -12634,28 +12640,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
1263412640set worktree [gitworktree]
1263512641setcoords
1263612642makewindow
12637- catch {
12638- image create photo gitlogo -width 16 -height 16
12639-
12640- image create photo gitlogominus -width 4 -height 2
12641- gitlogominus put #C00000 -to 0 0 4 2
12642- gitlogo copy gitlogominus -to 1 5
12643- gitlogo copy gitlogominus -to 6 5
12644- gitlogo copy gitlogominus -to 11 5
12645- image delete gitlogominus
12646-
12647- image create photo gitlogoplus -width 4 -height 4
12648- gitlogoplus put #008000 -to 1 0 3 4
12649- gitlogoplus put #008000 -to 0 1 4 3
12650- gitlogo copy gitlogoplus -to 1 9
12651- gitlogo copy gitlogoplus -to 6 9
12652- gitlogo copy gitlogoplus -to 11 9
12653- image delete gitlogoplus
12654-
12655- image create photo gitlogo32 -width 32 -height 32
12656- gitlogo32 copy gitlogo -zoom 2 2
12657-
12658- wm iconphoto . -default gitlogo gitlogo32
12643+ if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix /etc/git.ico]} {
12644+ wm iconbitmap . -default $gitk_prefix /etc/git.ico
12645+ } else {
12646+ catch {
12647+ image create photo gitlogo -width 16 -height 16
12648+
12649+ image create photo gitlogominus -width 4 -height 2
12650+ gitlogominus put #C00000 -to 0 0 4 2
12651+ gitlogo copy gitlogominus -to 1 5
12652+ gitlogo copy gitlogominus -to 6 5
12653+ gitlogo copy gitlogominus -to 11 5
12654+ image delete gitlogominus
12655+
12656+ image create photo gitlogoplus -width 4 -height 4
12657+ gitlogoplus put #008000 -to 1 0 3 4
12658+ gitlogoplus put #008000 -to 0 1 4 3
12659+ gitlogo copy gitlogoplus -to 1 9
12660+ gitlogo copy gitlogoplus -to 6 9
12661+ gitlogo copy gitlogoplus -to 11 9
12662+ image delete gitlogoplus
12663+
12664+ image create photo gitlogo32 -width 32 -height 32
12665+ gitlogo32 copy gitlogo -zoom 2 2
12666+
12667+ wm iconphoto . -default gitlogo gitlogo32
12668+ }
1265912669}
1266012670# wait for the window to become visible
1266112671tkwait visibility .
0 commit comments