From 9f9028b7ce9c23bd718c9bd2298d561e375594d7 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Tue, 19 Jan 2021 19:08:51 +0100 Subject: [PATCH] Fix "Add Word to Dictionary" missing when there are no spell suggestions --- nw/gui/doceditor.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index 3421276c..dace3fd3 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -1014,15 +1014,15 @@ class GuiDocEditor(QTextEdit): lambda thePos, aWord=aWord : self._correctWord(posCursor, aWord) ) mnuContext.addAction(mnuWord) - mnuContext.addSeparator() - mnuAdd = QAction("Add Word to Dictionary", mnuContext) - mnuAdd.triggered.connect(lambda thePos : self._addWord(posCursor)) - mnuContext.addAction(mnuAdd) - else: - mnuHead = QAction("No Suggestions", mnuContext) + mnuHead = QAction("%s No Suggestions" % nwUnicode.U_ENDASH, mnuContext) mnuContext.addAction(mnuHead) + mnuContext.addSeparator() + mnuAdd = QAction("Add Word to Dictionary", mnuContext) + mnuAdd.triggered.connect(lambda thePos : self._addWord(posCursor)) + mnuContext.addAction(mnuAdd) + # Open the context menu mnuContext.exec_(self.viewport().mapToGlobal(thePos))