[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>
OGAWA Hirofumi committed
Sep 27, 2006 at 12:32 UTC
67c22874cf82edae9b5c5f0a47c432d08d7ad426
1 file changed
+15
gitk
+15
@@ -4440,12 +4440,27 @@ proc getblobdiffline {bdf ids} {
4440
}
4441
}
4442
4443
+proc prevfile {} {
4444
+ global difffilestart ctext
4445
+ set prev [lindex $difffilestart 0]
4446
+ set here [$ctext index @0,0]
4447
+ foreach loc $difffilestart {
4448
+ if {[$ctext compare $loc >= $here]} {
4449
+ $ctext yview $prev
4450
+ return
4451
+ }
4452
+ set prev $loc
4453
+ }
4454
+ $ctext yview $prev
4455
+}
4456
+
4457
proc nextfile {} {
4458
global difffilestart ctext
4459
set here [$ctext index @0,0]
4460
foreach loc $difffilestart {
4461
if {[$ctext compare $loc > $here]} {
4462
$ctext yview $loc
4463
+ return
4464
}
4465
}
4466
}