From cde0d6dff5c78db28dbf3c4b7b2a1e8b76beca08 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sun, 25 Oct 2020 14:14:40 +0100 Subject: [PATCH] Only run word counter when a document is open --- nw/gui/doceditor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index 09792041..4546d717 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -1004,6 +1004,9 @@ class GuiDocEditor(QTextEdit): """Decide whether to run the word counter, or not due to inactivity. """ + if self.theHandle is None: + return + if self.wCounter.isRunning(): logger.verbose("Word counter is busy") return