Fix some minor issues with spell checking
This commit is contained in:
@@ -1095,6 +1095,12 @@ class GuiDocEditor(QPlainTextEdit):
|
||||
self._completer.hide()
|
||||
return
|
||||
|
||||
@pyqtSlot()
|
||||
def _openContextFromCursor(self) -> None:
|
||||
"""Open the spell check context menu at the cursor."""
|
||||
self._openContextMenu(self.cursorRect().center())
|
||||
return
|
||||
|
||||
@pyqtSlot("QPoint")
|
||||
def _openContextMenu(self, pos: QPoint) -> None:
|
||||
"""Open the editor context menu at a given coordinate."""
|
||||
@@ -1938,11 +1944,6 @@ class GuiDocEditor(QPlainTextEdit):
|
||||
self.requestProjectItemRenamed.emit(self._docHandle, text)
|
||||
return
|
||||
|
||||
def _openContextFromCursor(self) -> None:
|
||||
"""Open the spell check context menu at the cursor."""
|
||||
self._openContextMenu(self.cursorRect().center())
|
||||
return
|
||||
|
||||
def _docAutoReplace(self, text: str) -> None:
|
||||
"""Auto-replace text elements based on main configuration."""
|
||||
cursor = self.textCursor()
|
||||
|
||||
@@ -491,7 +491,7 @@ class TextBlockData(QTextBlockUserData):
|
||||
|
||||
self._spellErrors = []
|
||||
checker = SHARED.spelling
|
||||
for match in RX_WORDS.finditer(text.replace("_", " ")):
|
||||
for match in RX_WORDS.finditer(text.replace("_", " "), offset):
|
||||
if (
|
||||
(word := match.group(0))
|
||||
and not (word.isnumeric() or word.isupper() or checker.checkWord(word))
|
||||
|
||||
Reference in New Issue
Block a user