From 3f1cc2725a054c0704cf03173e147d146c1a6f73 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 20 Jan 2019 15:53:53 +0530 Subject: [PATCH] Ensure highlighting is done when going to sourceline --- src/calibre/gui2/tweak_book/editor/smarts/html.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/gui2/tweak_book/editor/smarts/html.py b/src/calibre/gui2/tweak_book/editor/smarts/html.py index fc75b8c913..e26e55d64e 100644 --- a/src/calibre/gui2/tweak_book/editor/smarts/html.py +++ b/src/calibre/gui2/tweak_book/editor/smarts/html.py @@ -527,6 +527,7 @@ class Smarts(NullSmarts): block = editor.document().findBlockByNumber(sourceline - 1) # blockNumber() is zero based if not block.isValid(): return found_tag + editor.highlighter.join() c = editor.textCursor() ud = block.userData() all_tags = [] if ud is None else [t for t in ud.tags if (t.is_start and not t.closing)]