summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kirillov <max@max630.net>2014-04-05 23:38:50 +0300
committerPaul Mackerras <paulus@samba.org>2014-06-15 11:35:50 +1000
commit4135d36b0c99329eff69686f7a17406053941b5c (patch)
treef3f997b1e5d4be5b2a3c380e111a2bc67fbd04d4
parentada2ea1695c4200dd9deaef2034cc453c27729f7 (diff)
downloadgit-4135d36b0c99329eff69686f7a17406053941b5c.tar.gz
gitk: Switch to patch mode when searching for line origin
If the "Show origin of this line" is started from tree mode, it still shows the result in tree mode, which I suppose not what user expects to see. Signed-off-by: Paul Mackerras <paulus@samba.org>
-rwxr-xr-xgitk8
1 files changed, 6 insertions, 2 deletions
diff --git a/gitk b/gitk
index 2f58bcfbdd..a4a8bd30ae 100755
--- a/gitk
+++ b/gitk
@@ -3871,7 +3871,7 @@ proc read_line_source {fd inst} {
set id $nullid2
}
if {[commitinview $id $curview]} {
- selectline [rowofcommit $id] 1 [list $fname $lnum]
+ selectline [rowofcommit $id] 1 [list $fname $lnum] 1
} else {
error_popup [mc "That line comes from commit %s, \
which is not in this view" [shortids $id]]
@@ -7162,7 +7162,7 @@ proc make_idmark {id} {
$canv raise $t
}
-proc selectline {l isnew {desired_loc {}}} {
+proc selectline {l isnew {desired_loc {}} {switch_to_patch 0}} {
global canv ctext commitinfo selectedline
global canvy0 linespc parents children curview
global currentid sha1entry
@@ -7188,6 +7188,10 @@ proc selectline {l isnew {desired_loc {}}} {
setcanvscroll
}
+ if {$cmitmode ne "patch" && $switch_to_patch} {
+ set cmitmode "patch"
+ }
+
set y [expr {$canvy0 + $l * $linespc}]
set ymax [lindex [$canv cget -scrollregion] 3]
set ytop [expr {$y - $linespc - 1}]