From 10936b69102f6a62528e1adc03b3f4fa633d3f3b Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Mon, 17 Aug 2020 22:40:04 +0200 Subject: [PATCH] Implement the same tab stop code in the editor as for the viewer --- nw/gui/doceditor.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index 737758bf..4cecfc7a 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -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):