From 2cb51f5b58e8c3c4f5b508e80fc79e983a5bfc50 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Mon, 1 Feb 2021 23:24:02 +0100 Subject: [PATCH] Backport a small fix from the dev branch --- nw/gui/doceditor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index 03f6b622..91a4b255 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -416,7 +416,9 @@ class GuiDocEditor(QTextEdit): self.theIndex.scanText(tHandle, docText) if self._updateHeaders(checkLevel=True): - self.theParent.novelView.refreshTree() + if self.theParent.projTabs.currentIndex() == self.theParent.idxNovelView: + logger.verbose("Document headers have changed, updating novel tree") + self.theParent.novelView.refreshTree() else: self.theParent.novelView.updateWordCounts(tHandle)