Added the option to show tabs and spaces and line endings.
This commit is contained in:
+8
-1
@@ -126,7 +126,7 @@ class GuiDocEditor(QTextEdit):
|
||||
# Reload dictionaries
|
||||
self.setDictionaries()
|
||||
|
||||
# Set Font
|
||||
# Set font
|
||||
theFont = QFont()
|
||||
if self.mainConf.textFont is None:
|
||||
# If none is defined, set the default back to config
|
||||
@@ -145,13 +145,20 @@ class GuiDocEditor(QTextEdit):
|
||||
|
||||
# Also set the document text options for the document text flow
|
||||
theOpt = QTextOption()
|
||||
|
||||
if self.mainConf.tabWidth is not None:
|
||||
if self.mainConf.verQtValue >= 51000:
|
||||
theOpt.setTabStopDistance(self.mainConf.tabWidth)
|
||||
if self.mainConf.doJustify:
|
||||
theOpt.setAlignment(Qt.AlignJustify)
|
||||
if self.mainConf.showTabsNSpaces:
|
||||
theOpt.setFlags(theOpt.flags() | QTextOption.ShowTabsAndSpaces)
|
||||
if self.mainConf.showLineEndings:
|
||||
theOpt.setFlags(theOpt.flags() | QTextOption.ShowLineAndParagraphSeparators)
|
||||
|
||||
self.qDocument.setDefaultTextOption(theOpt)
|
||||
|
||||
# Initialise the syntax highlighter
|
||||
self.hLight.initHighlighter()
|
||||
|
||||
# If we have a document open, we should reload it in case the font changed
|
||||
|
||||
Reference in New Issue
Block a user