aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>2006-09-27 12:32:19 +0900
committerPaul Mackerras <paulus@samba.org>2006-10-19 10:10:11 +1000
commit67c22874cf82edae9b5c5f0a47c432d08d7ad426 (patch)
tree31822fa8d6d56a35e582a363832ba02efd7178b5
parent561d038ab8adb2bab5ba368b88e620be18c4811b (diff)
downloadgit-67c22874cf82edae9b5c5f0a47c432d08d7ad426.tar.gz
git-67c22874cf82edae9b5c5f0a47c432d08d7ad426.tar.xz
[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>
-rwxr-xr-xgitk15
1 files changed, 15 insertions, 0 deletions
diff --git a/gitk b/gitk
index ebbeac63a..ab383b3ad 100755
--- a/gitk
+++ b/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
}
}
}