From b34eb8f460687a7c7c65b482bb4484e08dfe84a0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 4 Feb 2014 18:59:03 +0530 Subject: [PATCH] Fix tag highlighting breaking when a line is edited because of stale user data --- src/calibre/gui2/tweak_book/editor/syntax/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/gui2/tweak_book/editor/syntax/base.py b/src/calibre/gui2/tweak_book/editor/syntax/base.py index 9b404c7ea2..0ba4881935 100644 --- a/src/calibre/gui2/tweak_book/editor/syntax/base.py +++ b/src/calibre/gui2/tweak_book/editor/syntax/base.py @@ -53,6 +53,7 @@ class SyntaxHighlighter(QSyntaxHighlighter): def highlightBlock(self, text): try: state = self.previousBlockState() + self.setCurrentBlockUserData(None) # Ensure that any stale user data is discarded if state == -1: state = 0 state = self.state_class(state)