Skip to content

Commit cbe0d10

Browse files
committed
Merge 'gitk' into HEAD
2 parents 0a149ca + 48ca327 commit cbe0d10

File tree

1 file changed

+44
-34
lines changed

1 file changed

+44
-34
lines changed

gitk-git/gitk

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2076,7 +2076,7 @@ proc makewindow {} {
20762076
global headctxmenu progresscanv progressitem progresscoords statusw
20772077
global fprogitem fprogcoord lastprogupdate progupdatepending
20782078
global rprogitem rprogcoord rownumsel numcommits
2079-
global have_tk85 use_ttk NS
2079+
global have_tk85 have_tk86 use_ttk NS
20802080
global git_version
20812081
global worddiff
20822082

@@ -2566,8 +2566,13 @@ proc makewindow {} {
25662566
bind . <Key-Down> "selnextline 1"
25672567
bind . <Shift-Key-Up> "dofind -1 0"
25682568
bind . <Shift-Key-Down> "dofind 1 0"
2569-
bindkey <Key-Right> "goforw"
2570-
bindkey <Key-Left> "goback"
2569+
if {$have_tk86} {
2570+
bindkey <<NextChar>> "goforw"
2571+
bindkey <<PrevChar>> "goback"
2572+
} else {
2573+
bindkey <Key-Right> "goforw"
2574+
bindkey <Key-Left> "goback"
2575+
}
25712576
bind . <Key-Prior> "selnextpage -1"
25722577
bind . <Key-Next> "selnextpage 1"
25732578
bind . <$M1B-Home> "allcanvs yview moveto 0.0"
@@ -7671,7 +7676,7 @@ proc gettreeline {gtf id} {
76717676
if {[string index $fname 0] eq "\""} {
76727677
set fname [lindex $fname 0]
76737678
}
7674-
set fname [encoding convertfrom $fname]
7679+
set fname [encoding convertfrom utf-8 $fname]
76757680
lappend treefilelist($id) $fname
76767681
}
76777682
if {![eof $gtf]} {
@@ -7933,7 +7938,7 @@ proc gettreediffline {gdtf ids} {
79337938
if {[string index $file 0] eq "\""} {
79347939
set file [lindex $file 0]
79357940
}
7936-
set file [encoding convertfrom $file]
7941+
set file [encoding convertfrom utf-8 $file]
79377942
if {$file ne [lindex $treediff end]} {
79387943
lappend treediff $file
79397944
lappend sublist $file
@@ -8078,7 +8083,7 @@ proc makediffhdr {fname ids} {
80788083
global ctext curdiffstart treediffs diffencoding
80798084
global ctext_file_names jump_to_here targetline diffline
80808085

8081-
set fname [encoding convertfrom $fname]
8086+
set fname [encoding convertfrom utf-8 $fname]
80828087
set diffencoding [get_path_encoding $fname]
80838088
set i [lsearch -exact $treediffs($ids) $fname]
80848089
if {$i >= 0} {
@@ -8140,7 +8145,7 @@ proc parseblobdiffline {ids line} {
81408145

81418146
if {![string compare -length 5 "diff " $line]} {
81428147
if {![regexp {^diff (--cc|--git) } $line m type]} {
8143-
set line [encoding convertfrom $line]
8148+
set line [encoding convertfrom utf-8 $line]
81448149
$ctext insert end "$line\n" hunksep
81458150
continue
81468151
}
@@ -8187,7 +8192,7 @@ proc parseblobdiffline {ids line} {
81878192
makediffhdr $fname $ids
81888193

81898194
} elseif {![string compare -length 16 "* Unmerged path " $line]} {
8190-
set fname [encoding convertfrom [string range $line 16 end]]
8195+
set fname [encoding convertfrom utf-8 [string range $line 16 end]]
81918196
$ctext insert end "\n"
81928197
set curdiffstart [$ctext index "end - 1c"]
81938198
lappend ctext_file_names $fname
@@ -8242,7 +8247,7 @@ proc parseblobdiffline {ids line} {
82428247
if {[string index $fname 0] eq "\""} {
82438248
set fname [lindex $fname 0]
82448249
}
8245-
set fname [encoding convertfrom $fname]
8250+
set fname [encoding convertfrom utf-8 $fname]
82468251
set i [lsearch -exact $treediffs($ids) $fname]
82478252
if {$i >= 0} {
82488253
setinlist difffilestart $i $curdiffstart
@@ -8261,6 +8266,7 @@ proc parseblobdiffline {ids line} {
82618266
set diffinhdr 0
82628267
return
82638268
}
8269+
set line [encoding convertfrom utf-8 $line]
82648270
$ctext insert end "$line\n" filesep
82658271

82668272
} else {
@@ -10019,7 +10025,7 @@ proc showrefs {} {
1001910025
text $top.list -background $bgcolor -foreground $fgcolor \
1002010026
-selectbackground $selectbgcolor -font mainfont \
1002110027
-xscrollcommand "$top.xsb set" -yscrollcommand "$top.ysb set" \
10022-
-width 30 -height 20 -cursor $maincursor \
10028+
-width 60 -height 20 -cursor $maincursor \
1002310029
-spacing1 1 -spacing3 1 -state disabled
1002410030
$top.list tag configure highlight -background $selectbgcolor
1002510031
if {![lsearch -exact $bglist $top.list]} {
@@ -12210,7 +12216,7 @@ proc cache_gitattr {attr pathlist} {
1221012216
foreach row [split $rlist "\n"] {
1221112217
if {[regexp "(.*): $attr: (.*)" $row m path value]} {
1221212218
if {[string index $path 0] eq "\""} {
12213-
set path [encoding convertfrom [lindex $path 0]]
12219+
set path [encoding convertfrom utf-8 [lindex $path 0]]
1221412220
}
1221512221
set path_attr_cache($attr,$path) $value
1221612222
}
@@ -12240,7 +12246,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
1224012246
set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
1224112247
set gitk_libdir [file join $gitk_prefix share gitk lib]
1224212248
set gitk_msgsdir [file join $gitk_libdir msgs]
12243-
unset gitk_prefix
1224412249
}
1224512250

1224612251
## Internationalization (i18n) through msgcat and gettext. See
@@ -12538,6 +12543,7 @@ set nullid2 "0000000000000000000000000000000000000001"
1253812543
set nullfile "/dev/null"
1253912544

1254012545
set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}]
12546+
set have_tk86 [expr {[package vcompare $tk_version "8.6"] >= 0}]
1254112547
if {![info exists have_ttk]} {
1254212548
set have_ttk [llength [info commands ::ttk::style]]
1254312549
}
@@ -12602,28 +12608,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
1260212608
set worktree [exec git rev-parse --show-toplevel]
1260312609
setcoords
1260412610
makewindow
12605-
catch {
12606-
image create photo gitlogo -width 16 -height 16
12607-
12608-
image create photo gitlogominus -width 4 -height 2
12609-
gitlogominus put #C00000 -to 0 0 4 2
12610-
gitlogo copy gitlogominus -to 1 5
12611-
gitlogo copy gitlogominus -to 6 5
12612-
gitlogo copy gitlogominus -to 11 5
12613-
image delete gitlogominus
12614-
12615-
image create photo gitlogoplus -width 4 -height 4
12616-
gitlogoplus put #008000 -to 1 0 3 4
12617-
gitlogoplus put #008000 -to 0 1 4 3
12618-
gitlogo copy gitlogoplus -to 1 9
12619-
gitlogo copy gitlogoplus -to 6 9
12620-
gitlogo copy gitlogoplus -to 11 9
12621-
image delete gitlogoplus
12622-
12623-
image create photo gitlogo32 -width 32 -height 32
12624-
gitlogo32 copy gitlogo -zoom 2 2
12625-
12626-
wm iconphoto . -default gitlogo gitlogo32
12611+
if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
12612+
wm iconbitmap . -default $gitk_prefix/etc/git.ico
12613+
} else {
12614+
catch {
12615+
image create photo gitlogo -width 16 -height 16
12616+
12617+
image create photo gitlogominus -width 4 -height 2
12618+
gitlogominus put #C00000 -to 0 0 4 2
12619+
gitlogo copy gitlogominus -to 1 5
12620+
gitlogo copy gitlogominus -to 6 5
12621+
gitlogo copy gitlogominus -to 11 5
12622+
image delete gitlogominus
12623+
12624+
image create photo gitlogoplus -width 4 -height 4
12625+
gitlogoplus put #008000 -to 1 0 3 4
12626+
gitlogoplus put #008000 -to 0 1 4 3
12627+
gitlogo copy gitlogoplus -to 1 9
12628+
gitlogo copy gitlogoplus -to 6 9
12629+
gitlogo copy gitlogoplus -to 11 9
12630+
image delete gitlogoplus
12631+
12632+
image create photo gitlogo32 -width 32 -height 32
12633+
gitlogo32 copy gitlogo -zoom 2 2
12634+
12635+
wm iconphoto . -default gitlogo gitlogo32
12636+
}
1262712637
}
1262812638
# wait for the window to become visible
1262912639
tkwait visibility .

0 commit comments

Comments
 (0)