Implement the same tab stop code in the editor as for the viewer

This commit is contained in:
Veronica K. B. Olsen
2020-08-17 22:40:04 +02:00
parent 1d9cd3ee49
commit 10936b6910
+6 -2
View File
@@ -206,8 +206,6 @@ class GuiDocEditor(QTextEdit):
# Also set the document text options for the document text flow
theOpt = QTextOption()
if self.mainConf.verQtValue >= 51000:
theOpt.setTabStopDistance(self.mainConf.getTabWidth())
if self.mainConf.doJustify:
theOpt.setAlignment(Qt.AlignJustify)
if self.mainConf.showTabsNSpaces:
@@ -288,6 +286,12 @@ class GuiDocEditor(QTextEdit):
self.hLight.spellCheck = spTemp
qApp.restoreOverrideCursor()
# Refresh the tab stops
if self.mainConf.verQtValue >= 51000:
self.setTabStopDistance(self.mainConf.getTabWidth())
else:
self.setTabStopWidth(self.mainConf.getTabWidth())
return True
def replaceText(self, theText):