Skip to content

Commit 10ea981

Browse files
committed
filediff: Work around an inline highlighting issue using cached results
This is extremely weird, and I can't figure out what's going on. If the tags are applied in an idle handler, then we're fine. If they're applied directly then they don't show up. The inner logic of the apply_highlighting() callback looks to be identical in all cases, but obviously something is awry.
1 parent e347cef commit 10ea981

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

meld/filediff.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ def __init__(self):
7777
def match(self, text1, textn, cb):
7878
try:
7979
self.cache[(text1, textn)][1] = time.time()
80-
cb(self.cache[(text1, textn)][0])
80+
# FIXME: This idle should be totally unnecessary, and yet nothing
81+
# gets highlighted without it, even though everything in the
82+
# callback appears to run identically.
83+
GLib.idle_add(lambda: cb(self.cache[(text1, textn)][0]))
8184
except KeyError:
8285
def inline_cb(opcodes):
8386
self.cache[(text1, textn)] = [opcodes, time.time()]

0 commit comments

Comments
 (0)