Fix "Add Word to Dictionary" missing when there are no spell suggestions

This commit is contained in:
Veronica K. B. Olsen
2021-01-19 19:08:51 +01:00
parent e9be3242b2
commit 9f9028b7ce
+6 -6
View File
@@ -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))