This is based on suggestions by Jeff Epler and Linus Torvalds, but
extended so that we do the switching between the watch cursor and
the normal cursor correctly as well.
Also fixed a bug pointed out by Junio Hamano - I wasn't incrementing
the link number (duh!).
$canv create text 3 3 -anchor nw -text "Reading commits..." \
-font $mainfont -tags textitems
. config -cursor watch
$canv create text 3 3 -anchor nw -text "Reading commits..." \
-font $mainfont -tags textitems
. config -cursor watch
- $ctext config -cursor watch
}
proc getcommitlines {commfd} {
}
proc getcommitlines {commfd} {
global canv canv2 canv3 linespc charspc ctext cflist textfont
global findtype findtypemenu findloc findstring fstring geometry
global entries sha1entry sha1string sha1but
global canv canv2 canv3 linespc charspc ctext cflist textfont
global findtype findtypemenu findloc findstring fstring geometry
global entries sha1entry sha1string sha1but
- global maincursor textcursor
+ global maincursor textcursor curtextcursor
global rowctxmenu gaudydiff mergemax
menu .bar
global rowctxmenu gaudydiff mergemax
menu .bar
set maincursor [. cget -cursor]
set textcursor [$ctext cget -cursor]
set maincursor [. cget -cursor]
set textcursor [$ctext cget -cursor]
+ set curtextcursor $textcursor
set rowctxmenu .rowctxmenu
menu $rowctxmenu -tearoff 0
set rowctxmenu .rowctxmenu
menu $rowctxmenu -tearoff 0
drawrest $level [llength $startcommits]
}
. config -cursor $maincursor
drawrest $level [llength $startcommits]
}
. config -cursor $maincursor
- $ctext config -cursor $textcursor
+ settextcursor $textcursor
+}
+
+# Don't change the text pane cursor if it is currently the hand cursor,
+# showing that we are over a sha1 ID link.
+proc settextcursor {c} {
+ global ctext curtextcursor
+
+ if {[$ctext cget -cursor] == $curtextcursor} {
+ $ctext config -cursor $c
+ }
+ set curtextcursor $c
unset findinprogress
if {$phase != "incrdraw"} {
. config -cursor $maincursor
unset findinprogress
if {$phase != "incrdraw"} {
. config -cursor $maincursor
- $ctext config -cursor $textcursor
+ settextcursor $textcursor
fileevent $f readable readfindproc
set finddidsel 0
. config -cursor watch
fileevent $f readable readfindproc
set finddidsel 0
. config -cursor watch
- $ctext config -cursor watch
set id $lineid($l)
set p [lindex $parents($id) 0]
. config -cursor watch
set id $lineid($l)
set p [lindex $parents($id) 0]
. config -cursor watch
- $ctext config -cursor watch
set findinprogress 1
findcont [list $id $p]
update
set findinprogress 1
findcont [list $id $p]
update
set linkid [string range $comment $s $e]
if {![info exists idline($linkid)]} continue
incr e
set linkid [string range $comment $s $e]
if {![info exists idline($linkid)]} continue
incr e
- $ctext tag conf link$i -foreground blue -underline 1
+ $ctext tag add link "$commentstart + $s c" "$commentstart + $e c"
$ctext tag add link$i "$commentstart + $s c" "$commentstart + $e c"
$ctext tag bind link$i <1> [list selectline $idline($linkid) 1]
$ctext tag add link$i "$commentstart + $s c" "$commentstart + $e c"
$ctext tag bind link$i <1> [list selectline $idline($linkid) 1]
+ $ctext tag conf link -foreground blue -underline 1
+ $ctext tag bind link <Enter> { %W configure -cursor hand2 }
+ $ctext tag bind link <Leave> { %W configure -cursor $curtextcursor }
$ctext tag delete Comments
$ctext tag remove found 1.0 end
$ctext tag delete Comments
$ctext tag remove found 1.0 end