summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 63b7919)
raw | patch | inline | side by side (parent: 63b7919)
author | Paul Mackerras <paulus@samba.org> | |
Sat, 20 May 2006 12:56:27 +0000 (22:56 +1000) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Sat, 20 May 2006 12:56:27 +0000 (22:56 +1000) |
With this, when the file list window is in tree view mode, we highlight
the paths of interest.
Signed-off-by: Paul Mackerras <paulus@samba.org>
the paths of interest.
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk | patch | blob | history |
index 52013323eee9468b9d66d1ed36cdf155e79c9f9c..2e0450437f0aa8dc2b04f1a878d588a5069e24e1 100755 (executable)
--- a/gitk
+++ b/gitk
$w insert end $str
$w image create end -align center -image $bm -padx 1 \
-name a:$ix
- $w insert end $d
+ $w insert end $d [highlight_tag $prefix]
$w mark set s:$ix "end -1c"
$w mark gravity s:$ix left
}
set str "\n"
for {set i 0} {$i < $lev} {incr i} {append str "\t"}
$w insert end $str
- $w insert end $tail
+ $w insert end $tail [highlight_tag $f]
}
lappend treecontents($prefix) $tail
}
}
}
+proc highlight_tree {y prefix} {
+ global treeheight treecontents cflist
+
+ foreach e $treecontents($prefix) {
+ set path $prefix$e
+ if {[highlight_tag $path] ne {}} {
+ $cflist tag add bold $y.0 "$y.0 lineend"
+ }
+ incr y
+ if {[string index $e end] eq "/" && $treeheight($path) > 1} {
+ set y [highlight_tree $y $path]
+ }
+ }
+ return $y
+}
+
proc treeclosedir {w dir} {
global treediropen treeheight treeparent treeindex
incr treeheight($x) $n
}
foreach e $treecontents($dir) {
+ set de $dir$e
if {[string index $e end] eq "/"} {
- set de $dir$e
set iy $treeindex($de)
$w mark set d:$iy e:$ix
$w mark gravity d:$iy left
set treediropen($de) 0
$w image create e:$ix -align center -image tri-rt -padx 1 \
-name a:$iy
- $w insert e:$ix $e
+ $w insert e:$ix $e [highlight_tag $de]
$w mark set s:$iy e:$ix
$w mark gravity s:$iy left
set treeheight($de) 1
} else {
$w insert e:$ix $str
- $w insert e:$ix $e
+ $w insert e:$ix $e [highlight_tag $de]
}
}
$w mark gravity e:$ix left
}
proc highlight_filelist {} {
- global flistmode cflist
+ global cmitmode cflist
- global highlight_paths
- if {$flistmode eq "flat"} {
- $cflist conf -state normal
+ $cflist conf -state normal
+ if {$cmitmode ne "tree"} {
set end [lindex [split [$cflist index end] .] 0]
for {set l 2} {$l < $end} {incr l} {
set line [$cflist get $l.0 "$l.0 lineend"]
$cflist tag add bold $l.0 "$l.0 lineend"
}
}
- $cflist conf -state disabled
+ } else {
+ highlight_tree 2 {}
}
+ $cflist conf -state disabled
}
proc unhighlight_filelist {} {
- global flistmode cflist
+ global cflist
- if {$flistmode eq "flat"} {
- $cflist conf -state normal
- $cflist tag remove bold 1.0 end
- $cflist conf -state disabled
- }
+ $cflist conf -state normal
+ $cflist tag remove bold 1.0 end
+ $cflist conf -state disabled
}
proc add_flist {fl} {
- global flistmode cflist
+ global cflist
- if {$flistmode eq "flat"} {
- $cflist conf -state normal
- foreach f $fl {
- $cflist insert end "\n"
- $cflist insert end $f [highlight_tag $f]
- }
- $cflist conf -state disabled
+ $cflist conf -state normal
+ foreach f $fl {
+ $cflist insert end "\n"
+ $cflist insert end $f [highlight_tag $f]
}
+ $cflist conf -state disabled
}
proc sel_flist {w x y} {
- global flistmode ctext difffilestart cflist cflist_top cmitmode
+ global ctext difffilestart cflist cflist_top cmitmode
if {$cmitmode eq "tree"} return
if {![info exists cflist_top]} return
set uparrowlen 7
set downarrowlen 7
set mingaplen 30
-set flistmode "flat"
set cmitmode "patch"
set colors {green red blue magenta darkgrey brown orange}