@@ -2099,7 +2099,7 @@ proc makewindow {} {
20992099 global headctxmenu progresscanv progressitem progresscoords statusw
21002100 global fprogitem fprogcoord lastprogupdate progupdatepending
21012101 global rprogitem rprogcoord rownumsel numcommits
2102- global have_tk85 use_ttk NS
2102+ global have_tk85 have_tk86 use_ttk NS
21032103 global git_version
21042104 global worddiff
21052105
@@ -2597,8 +2597,13 @@ proc makewindow {} {
25972597 bind . <Key-Down> " selnextline 1"
25982598 bind . <Shift-Key-Up> " dofind -1 0"
25992599 bind . <Shift-Key-Down> " dofind 1 0"
2600- bindkey <Key-Right> " goforw"
2601- bindkey <Key-Left> " goback"
2600+ if {$have_tk86 } {
2601+ bindkey <<NextChar>> " goforw"
2602+ bindkey <<PrevChar>> " goback"
2603+ } else {
2604+ bindkey <Key-Right> " goforw"
2605+ bindkey <Key-Left> " goback"
2606+ }
26022607 bind . <Key-Prior> " selnextpage -1"
26032608 bind . <Key-Next> " selnextpage 1"
26042609 bind . <$M1B -Home> " allcanvs yview moveto 0.0"
@@ -7712,7 +7717,7 @@ proc gettreeline {gtf id} {
77127717 if {[string index $fname 0] eq " \" " } {
77137718 set fname [lindex $fname 0]
77147719 }
7715- set fname [encoding convertfrom $fname ]
7720+ set fname [encoding convertfrom utf-8 $fname ]
77167721 lappend treefilelist($id ) $fname
77177722 }
77187723 if {![eof $gtf ]} {
@@ -7974,7 +7979,7 @@ proc gettreediffline {gdtf ids} {
79747979 if {[string index $file 0] eq " \" " } {
79757980 set file [lindex $file 0]
79767981 }
7977- set file [encoding convertfrom $file ]
7982+ set file [encoding convertfrom utf-8 $file ]
79787983 if {$file ne [lindex $treediff end]} {
79797984 lappend treediff $file
79807985 lappend sublist $file
@@ -8119,7 +8124,7 @@ proc makediffhdr {fname ids} {
81198124 global ctext curdiffstart treediffs diffencoding
81208125 global ctext_file_names jump_to_here targetline diffline
81218126
8122- set fname [encoding convertfrom $fname ]
8127+ set fname [encoding convertfrom utf-8 $fname ]
81238128 set diffencoding [get_path_encoding $fname ]
81248129 set i [lsearch -exact $treediffs($ids) $fname ]
81258130 if {$i >= 0} {
@@ -8181,7 +8186,7 @@ proc parseblobdiffline {ids line} {
81818186
81828187 if {![string compare -length 5 " diff " $line ]} {
81838188 if {![regexp {^diff (--cc|--git) } $line m type]} {
8184- set line [encoding convertfrom $line ]
8189+ set line [encoding convertfrom utf-8 $line ]
81858190 $ctext insert end " $line \n " hunksep
81868191 continue
81878192 }
@@ -8230,7 +8235,7 @@ proc parseblobdiffline {ids line} {
82308235 makediffhdr $fname $ids
82318236
82328237 } elseif {![string compare -length 16 " * Unmerged path " $line ]} {
8233- set fname [encoding convertfrom [string range $line 16 end]]
8238+ set fname [encoding convertfrom utf-8 [string range $line 16 end]]
82348239 $ctext insert end " \n "
82358240 set curdiffstart [$ctext index " end - 1c" ]
82368241 lappend ctext_file_names $fname
@@ -8283,7 +8288,7 @@ proc parseblobdiffline {ids line} {
82838288 if {[string index $fname 0] eq " \" " } {
82848289 set fname [lindex $fname 0]
82858290 }
8286- set fname [encoding convertfrom $fname ]
8291+ set fname [encoding convertfrom utf-8 $fname ]
82878292 set i [lsearch -exact $treediffs($ids) $fname ]
82888293 if {$i >= 0} {
82898294 setinlist difffilestart $i $curdiffstart
@@ -8302,6 +8307,7 @@ proc parseblobdiffline {ids line} {
83028307 set diffinhdr 0
83038308 return
83048309 }
8310+ set line [encoding convertfrom utf-8 $line ]
83058311 $ctext insert end " $line \n " filesep
83068312
83078313 } else {
@@ -10060,7 +10066,7 @@ proc showrefs {} {
1006010066 text $top .list -background $bgcolor -foreground $fgcolor \
1006110067 -selectbackground $selectbgcolor -font mainfont \
1006210068 -xscrollcommand " $top .xsb set" -yscrollcommand " $top .ysb set" \
10063- -width 30 -height 20 -cursor $maincursor \
10069+ -width 60 -height 20 -cursor $maincursor \
1006410070 -spacing1 1 -spacing3 1 -state disabled
1006510071 $top .list tag configure highlight -background $selectbgcolor
1006610072 if {![lsearch -exact $bglist $top .list]} {
@@ -12270,7 +12276,7 @@ proc cache_gitattr {attr pathlist} {
1227012276 foreach row [split $rlist " \n " ] {
1227112277 if {[regexp "(.*): $attr : (.*)" $row m path value]} {
1227212278 if {[string index $path 0] eq " \" " } {
12273- set path [encoding convertfrom [lindex $path 0]]
12279+ set path [encoding convertfrom utf-8 [lindex $path 0]]
1227412280 }
1227512281 set path_attr_cache($attr ,$path ) $value
1227612282 }
@@ -12300,7 +12306,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
1230012306 set gitk_prefix [file dirname [file dirname [file normalize $argv0 ]]]
1230112307 set gitk_libdir [file join $gitk_prefix share gitk lib]
1230212308 set gitk_msgsdir [file join $gitk_libdir msgs]
12303- unset gitk_prefix
1230412309}
1230512310
1230612311# # Internationalization (i18n) through msgcat and gettext. See
@@ -12599,6 +12604,7 @@ set nullid2 "0000000000000000000000000000000000000001"
1259912604set nullfile " /dev/null"
1260012605
1260112606set have_tk85 [expr {[package vcompare $tk_version " 8.5" ] >= 0}]
12607+ set have_tk86 [expr {[package vcompare $tk_version " 8.6" ] >= 0}]
1260212608if {![info exists have_ttk]} {
1260312609 set have_ttk [llength [info commands ::ttk::style]]
1260412610}
@@ -12663,28 +12669,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
1266312669set worktree [gitworktree]
1266412670setcoords
1266512671makewindow
12666- catch {
12667- image create photo gitlogo -width 16 -height 16
12668-
12669- image create photo gitlogominus -width 4 -height 2
12670- gitlogominus put #C00000 -to 0 0 4 2
12671- gitlogo copy gitlogominus -to 1 5
12672- gitlogo copy gitlogominus -to 6 5
12673- gitlogo copy gitlogominus -to 11 5
12674- image delete gitlogominus
12675-
12676- image create photo gitlogoplus -width 4 -height 4
12677- gitlogoplus put #008000 -to 1 0 3 4
12678- gitlogoplus put #008000 -to 0 1 4 3
12679- gitlogo copy gitlogoplus -to 1 9
12680- gitlogo copy gitlogoplus -to 6 9
12681- gitlogo copy gitlogoplus -to 11 9
12682- image delete gitlogoplus
12683-
12684- image create photo gitlogo32 -width 32 -height 32
12685- gitlogo32 copy gitlogo -zoom 2 2
12686-
12687- wm iconphoto . -default gitlogo gitlogo32
12672+ if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix /etc/git.ico]} {
12673+ wm iconbitmap . -default $gitk_prefix /etc/git.ico
12674+ } else {
12675+ catch {
12676+ image create photo gitlogo -width 16 -height 16
12677+
12678+ image create photo gitlogominus -width 4 -height 2
12679+ gitlogominus put #C00000 -to 0 0 4 2
12680+ gitlogo copy gitlogominus -to 1 5
12681+ gitlogo copy gitlogominus -to 6 5
12682+ gitlogo copy gitlogominus -to 11 5
12683+ image delete gitlogominus
12684+
12685+ image create photo gitlogoplus -width 4 -height 4
12686+ gitlogoplus put #008000 -to 1 0 3 4
12687+ gitlogoplus put #008000 -to 0 1 4 3
12688+ gitlogo copy gitlogoplus -to 1 9
12689+ gitlogo copy gitlogoplus -to 6 9
12690+ gitlogo copy gitlogoplus -to 11 9
12691+ image delete gitlogoplus
12692+
12693+ image create photo gitlogo32 -width 32 -height 32
12694+ gitlogo32 copy gitlogo -zoom 2 2
12695+
12696+ wm iconphoto . -default gitlogo gitlogo32
12697+ }
1268812698}
1268912699# wait for the window to become visible
1269012700tkwait visibility .
0 commit comments