From 53dfdb3a2e532122389fd593455345595b6b7b82 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Wed, 22 Jan 2025 00:48:59 +0100 Subject: [PATCH] Fix potential undefined variable in editor --- novelwriter/gui/doceditor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/novelwriter/gui/doceditor.py b/novelwriter/gui/doceditor.py index c95023d9..63be85b1 100644 --- a/novelwriter/gui/doceditor.py +++ b/novelwriter/gui/doceditor.py @@ -1104,10 +1104,10 @@ class GuiDocEditor(QPlainTextEdit): else: self._completer.setVisible(False) - if self._doReplace and added == 1: - cursor = self.textCursor() - if self._autoReplace.process(text, cursor): - self._qDocument.syntaxHighlighter.rehighlightBlock(cursor.block()) + if self._doReplace and added == 1: + cursor = self.textCursor() + if self._autoReplace.process(text, cursor): + self._qDocument.syntaxHighlighter.rehighlightBlock(cursor.block()) return