Fixed some bits and added spellcheck to the highlighting class using pyenchant

This commit is contained in:
Veronica K. B. Olsen
2019-05-04 21:39:05 +02:00
parent e55c92d83a
commit 7c391eb660
4 changed files with 32 additions and 7 deletions
+6 -2
View File
@@ -12,6 +12,7 @@
import logging
import nw
import enchant
from time import time
@@ -49,6 +50,11 @@ class GuiDocEditor(QTextEdit):
self.typSQClose = self.mainConf.fmtSingleQuotes[1]
self.typApos = self.mainConf.fmtApostrophe
# Core Elements
self.theDoc = self.document()
self.theDict = enchant.Dict("en_GB")
self.hLight = GuiDocHighlighter(self.theDoc, self.theDict)
# Editor State
self.hasSelection = False
@@ -60,8 +66,6 @@ class GuiDocEditor(QTextEdit):
mLR = self.mainConf.textMargin[1]
self.setViewportMargins(mLR,mTB,mLR,mTB)
self.theDoc = self.document()
self.hLight = GuiDocHighlighter(self.theDoc)
self.theDoc.setDocumentMargin(0)
self.theDoc.contentsChange.connect(self._docChange)
if self.mainConf.doJustify: