mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
[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:
parent
561d038ab8
commit
67c22874cf
15
gitk
15
gitk
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue