Sort out spelling highlighting

This commit is contained in:
Tim Bentley 2010-09-04 11:39:48 +01:00
parent 04cfa6a730
commit 26bceb84b9

View File

@ -60,6 +60,8 @@ class SpellTextEdit(QtGui.QPlainTextEdit):
popup_menu = self.createStandardContextMenu()
# Select the word under the cursor.
cursor = self.textCursor()
# only select text if not already selected
if not cursor.hasSelection():
cursor.select(QtGui.QTextCursor.WordUnderCursor)
self.setTextCursor(cursor)
# Check if the selected word is misspelled and offer spelling
@ -86,7 +88,6 @@ class SpellTextEdit(QtGui.QPlainTextEdit):
tag_menu.addAction(action)
popup_menu.insertSeparator(popup_menu.actions()[0])
popup_menu.insertMenu(popup_menu.actions()[0], tag_menu)
popup_menu.exec_(event.globalPos())
def correctWord(self, word):