Fix tag highlighting breaking when a line is edited because of stale user data

This commit is contained in:
Kovid Goyal 2014-02-04 18:59:03 +05:30
parent d59f9c6f73
commit b34eb8f460

View File

@ -53,6 +53,7 @@ class SyntaxHighlighter(QSyntaxHighlighter):
def highlightBlock(self, text): def highlightBlock(self, text):
try: try:
state = self.previousBlockState() state = self.previousBlockState()
self.setCurrentBlockUserData(None) # Ensure that any stale user data is discarded
if state == -1: if state == -1:
state = 0 state = 0
state = self.state_class(state) state = self.state_class(state)