Skip to content

Commit bff898b

Browse files
author
Junio C Hamano
committed
Merge git://git2.kernel.org/pub/scm/gitk/gitk into maint
* git://git2.kernel.org/pub/scm/gitk/gitk: gitk: Allow user to choose whether to see the diff, old file, or new file
2 parents 604d7a1 + a8d610a commit bff898b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

gitk

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ proc makewindow {} {
593593
frame .bleft -width $geometry(botwidth) -height $geometry(botheight)
594594
}
595595
frame .bleft.top
596+
frame .bleft.mid
596597

597598
button .bleft.top.search -text "Search" -command dosearch \
598599
-font $uifont
@@ -602,12 +603,20 @@ proc makewindow {} {
602603
lappend entries $sstring
603604
trace add variable searchstring write incrsearch
604605
pack $sstring -side left -expand 1 -fill x
606+
radiobutton .bleft.mid.diff -text "Diff" \
607+
-command changediffdisp -variable diffelide -value {0 0}
608+
radiobutton .bleft.mid.old -text "Old version" \
609+
-command changediffdisp -variable diffelide -value {0 1}
610+
radiobutton .bleft.mid.new -text "New version" \
611+
-command changediffdisp -variable diffelide -value {1 0}
612+
pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left
605613
set ctext .bleft.ctext
606614
text $ctext -background $bgcolor -foreground $fgcolor \
607615
-state disabled -font $textfont \
608616
-yscrollcommand scrolltext -wrap none
609617
scrollbar .bleft.sb -command "$ctext yview"
610618
pack .bleft.top -side top -fill x
619+
pack .bleft.mid -side top -fill x
611620
pack .bleft.sb -side right -fill y
612621
pack $ctext -side left -fill both -expand 1
613622
lappend bglist $ctext
@@ -4486,6 +4495,13 @@ proc getblobdiffline {bdf ids} {
44864495
}
44874496
}
44884497

4498+
proc changediffdisp {} {
4499+
global ctext diffelide
4500+
4501+
$ctext tag conf d0 -elide [lindex $diffelide 0]
4502+
$ctext tag conf d1 -elide [lindex $diffelide 1]
4503+
}
4504+
44894505
proc prevfile {} {
44904506
global difffilestart ctext
44914507
set prev [lindex $difffilestart 0]
@@ -6330,6 +6346,7 @@ set highlight_paths {}
63306346
set searchdirn -forwards
63316347
set boldrows {}
63326348
set boldnamerows {}
6349+
set diffelide {0 0}
63336350

63346351
set optim_delay 16
63356352

0 commit comments

Comments
 (0)