Skip to content

Commit

Permalink
[PATCH] gitk: Fix nextfile() and add prevfile()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
OGAWA Hirofumi authored and Paul Mackerras committed Oct 19, 2006
1 parent 561d038 commit 67c2287
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down

0 comments on commit 67c2287

Please sign in to comment.