[PATCH] gitk: Fix nextfile() and add prevfile()

The current nextfile() jumps to last hunk, but I think this is not
intention, probably, it's forgetting to add "break;". And this
patch also adds prevfile(), it jumps to previous hunk.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
OGAWA Hirofumi 2006-09-27 12:32:19 +09:00 committed by Paul Mackerras
parent 561d038ab8
commit 67c22874cf

15
gitk
View file

@ -4440,12 +4440,27 @@ proc getblobdiffline {bdf ids} {
}
}
proc prevfile {} {
global difffilestart ctext
set prev [lindex $difffilestart 0]
set here [$ctext index @0,0]
foreach loc $difffilestart {
if {[$ctext compare $loc >= $here]} {
$ctext yview $prev
return
}
set prev $loc
}
$ctext yview $prev
}
proc nextfile {} {
global difffilestart ctext
set here [$ctext index @0,0]
foreach loc $difffilestart {
if {[$ctext compare $loc > $here]} {
$ctext yview $loc
return
}
}
}