Skip to content

Commit 67c2287

Browse files
OGAWAHirofumipaulusmack
authored andcommitted
[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 <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent 561d038 commit 67c2287

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

gitk

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4440,12 +4440,27 @@ proc getblobdiffline {bdf ids} {
44404440
}
44414441
}
44424442

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+
44434457
proc nextfile {} {
44444458
global difffilestart ctext
44454459
set here [$ctext index @0,0]
44464460
foreach loc $difffilestart {
44474461
if {[$ctext compare $loc > $here]} {
44484462
$ctext yview $loc
4463+
return
44494464
}
44504465
}
44514466
}

0 commit comments

Comments
 (0)