spellcheck: show 'add to dictionary' even if a word has no suggestions

This commit is contained in:
Youness Alaoui 2019-03-27 16:37:59 -04:00 committed by Curtis Gedak
parent f9b181ff67
commit 5c33ce54f3

View file

@ -464,9 +464,6 @@ class textEditView(QTextEdit):
action = self.SpellAction(word, spell_menu)
action.correct.connect(self.correctWord)
spell_menu.addAction(action)
# Only add the spelling suggests to the menu if there are
# suggestions.
if len(spell_menu.actions()) != 0:
popup_menu.insertSeparator(popup_menu.actions()[0])
# Adds: add to dictionary
addAction = QAction(self.tr("&Add to dictionary"), popup_menu)
@ -474,6 +471,9 @@ class textEditView(QTextEdit):
addAction.triggered.connect(self.addWordToDict)
addAction.setData(selectedWord)
popup_menu.insertAction(popup_menu.actions()[0], addAction)
# Only add the spelling suggests to the menu if there are
# suggestions.
if len(spell_menu.actions()) != 0:
# Adds: suggestions
popup_menu.insertMenu(popup_menu.actions()[0], spell_menu)
# popup_menu.insertSeparator(popup_menu.actions()[0])