Connect rehighlight tags in editor to index signal on tags change (#1916)
This commit is contained in:
@@ -436,11 +436,6 @@ class GuiDocEditor(QPlainTextEdit):
|
||||
|
||||
return True
|
||||
|
||||
def updateTagHighLighting(self) -> None:
|
||||
"""Rerun the syntax highlighter on all meta data lines."""
|
||||
self._qDocument.syntaxHighlighter.rehighlightByType(BLOCK_META)
|
||||
return
|
||||
|
||||
def replaceText(self, text: str) -> None:
|
||||
"""Replace the text of the current document with the provided
|
||||
text. This also clears undo history.
|
||||
@@ -1034,6 +1029,13 @@ class GuiDocEditor(QPlainTextEdit):
|
||||
self.beginSearch()
|
||||
return
|
||||
|
||||
@pyqtSlot(list, list)
|
||||
def updateChangedTags(self, updated: list[str], deleted: list[str]) -> None:
|
||||
"""Tags have changed, so just in case we rehighlight them."""
|
||||
if updated or deleted:
|
||||
self._qDocument.syntaxHighlighter.rehighlightByType(BLOCK_META)
|
||||
return
|
||||
|
||||
##
|
||||
# Private Slots
|
||||
##
|
||||
|
||||
Reference in New Issue
Block a user