summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 590915d)
raw | patch | inline | side by side (parent: 590915d)
author | Paul Mackerras <paulus@samba.org> | |
Thu, 13 Nov 2008 11:39:00 +0000 (22:39 +1100) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Thu, 13 Nov 2008 11:39:00 +0000 (22:39 +1100) |
Occasionally gitk will throw a Tcl error complaining that linehtag(n)
is undefined when. It happens when the commit list is still growing
(e.g. when updating the commit list) and gitk is set to highlight
commits that affect certain file(s). What happens is that the changes
to the commit list set need_redisplay to indicate that the display
needs to be redrawn. That causes the next call to drawcommits to call
clear_display, which unsets iddrawn and thus ensures that readfhighlight
won't call bolden on any rows that have moved. However, it is possible
for readfhighlight to be called after the commit list has changed but
before drawcommits has run, meaning that readfhighlight will potentially
think that rows have been drawn when they haven't, because of the
change in the id -> row mapping (and the fact that iddrawn is indexed
by id but line[hnd]tag are indexed by row number).
This fixes it (and also optimizes things a little) by making bolden
and bolden_name check need_redisplay before doing anything. If
need_redisplay is set, then there is no point doing anything because
the whole display is about to get cleared and redrawn, and it avoids
looking up line[hn]tag using stale row numbers.
Signed-off-by: Paul Mackerras <paulus@samba.org>
is undefined when. It happens when the commit list is still growing
(e.g. when updating the commit list) and gitk is set to highlight
commits that affect certain file(s). What happens is that the changes
to the commit list set need_redisplay to indicate that the display
needs to be redrawn. That causes the next call to drawcommits to call
clear_display, which unsets iddrawn and thus ensures that readfhighlight
won't call bolden on any rows that have moved. However, it is possible
for readfhighlight to be called after the commit list has changed but
before drawcommits has run, meaning that readfhighlight will potentially
think that rows have been drawn when they haven't, because of the
change in the id -> row mapping (and the fact that iddrawn is indexed
by id but line[hnd]tag are indexed by row number).
This fixes it (and also optimizes things a little) by making bolden
and bolden_name check need_redisplay before doing anything. If
need_redisplay is set, then there is no point doing anything because
the whole display is about to get cleared and redrawn, and it avoids
looking up line[hn]tag using stale row numbers.
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk | patch | blob | history |
index 3864d3826de6ea24fb807cc2346d74d84c39db42..3353f4a2717ceb72634b9311985b5570f06fe560 100755 (executable)
--- a/gitk
+++ b/gitk
}
proc bolden {row font} {
- global canv linehtag selectedline boldrows
+ global canv linehtag selectedline boldrows need_redisplay
+ # need_redisplay = 1 means the display is stale and about to be redrawn
+ if {$need_redisplay} return
lappend boldrows $row
$canv itemconf $linehtag($row) -font $font
if {$row == $selectedline} {
}
proc bolden_name {row font} {
- global canv2 linentag selectedline boldnamerows
+ global canv2 linentag selectedline boldnamerows need_redisplay
+ if {$need_redisplay} return
lappend boldnamerows $row
$canv2 itemconf $linentag($row) -font $font
if {$row == $selectedline} {