mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Fix tag highlighting breaking when a line is edited because of stale user data
This commit is contained in:
parent
d59f9c6f73
commit
b34eb8f460
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user