Improved highlighter performance and disabled initial spell checking

This commit is contained in:
Veronica K. B. Olsen committed 2019-11-19 18:19:38 +01:00
1 parent aee7a1a66d
commit 2217f1d89c
2 files changed
+30 -47

No files matched your search

+9
View File
@@ -214,7 +214,14 @@ class GuiDocEditor(QTextEdit):
return False
self.hLight.setHandle(tHandle)
spTemp = self.hLight.spellCheck
self.hLight.spellCheck = False
bfTime = time()
self.setPlainText(theDoc)
afTime = time()
logger.debug("Document highlighted in %.3f milliseconds" % (1000*(afTime-bfTime)))
self.setCursorPosition(self.nwDocument.theItem.cursorPos)
self.lastEdit = time()
self._runCounter()
@@ -227,6 +234,8 @@ class GuiDocEditor(QTextEdit):
else:
self.theParent.noticeBar.showNote("This document is read only.")
self.hLight.spellCheck = spTemp
return True
def replaceText(self, theText):