[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:

committed by
Paul Mackerras

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 {} {
|
proc nextfile {} {
|
||||||
global difffilestart ctext
|
global difffilestart ctext
|
||||||
set here [$ctext index @0,0]
|
set here [$ctext index @0,0]
|
||||||
foreach loc $difffilestart {
|
foreach loc $difffilestart {
|
||||||
if {[$ctext compare $loc > $here]} {
|
if {[$ctext compare $loc > $here]} {
|
||||||
$ctext yview $loc
|
$ctext yview $loc
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user