Added an option to turn off syntax highlighting for text in quotes
This commit is contained in:
@@ -222,6 +222,13 @@ class GuiConfigEditGeneralTab(QWidget):
|
||||
self.showFullPath
|
||||
)
|
||||
|
||||
self.highlightQuotes = QSwitch()
|
||||
self.highlightQuotes.setChecked(self.mainConf.highlightQuotes)
|
||||
self.mainForm.addRow(
|
||||
"Add highlighting to text in quotes",
|
||||
self.highlightQuotes
|
||||
)
|
||||
|
||||
# AutoSave Settings
|
||||
# =================
|
||||
self.mainForm.addGroupLabel("Automatic Save")
|
||||
@@ -296,6 +303,7 @@ class GuiConfigEditGeneralTab(QWidget):
|
||||
guiIcons = self.selectIcons.currentData()
|
||||
guiDark = self.preferDarkIcons.isChecked()
|
||||
showFullPath = self.showFullPath.isChecked()
|
||||
highlightQuotes = self.highlightQuotes.isChecked()
|
||||
autoSaveDoc = self.autoSaveDoc.value()
|
||||
autoSaveProj = self.autoSaveProj.value()
|
||||
backupPath = self.backupPath
|
||||
@@ -311,6 +319,7 @@ class GuiConfigEditGeneralTab(QWidget):
|
||||
self.mainConf.guiIcons = guiIcons
|
||||
self.mainConf.guiDark = guiDark
|
||||
self.mainConf.showFullPath = showFullPath
|
||||
self.mainConf.highlightQuotes = highlightQuotes
|
||||
self.mainConf.autoSaveDoc = autoSaveDoc
|
||||
self.mainConf.autoSaveProj = autoSaveProj
|
||||
self.mainConf.backupPath = backupPath
|
||||
|
||||
@@ -159,22 +159,24 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
||||
))
|
||||
|
||||
# Quoted Strings
|
||||
self.hRules.append((
|
||||
"{:s}(.+?){:s}".format('"','"'), {
|
||||
0 : self.hStyles["dialogue1"],
|
||||
}
|
||||
))
|
||||
self.hRules.append((
|
||||
"{:s}(.+?){:s}".format(*self.mainConf.fmtDoubleQuotes), {
|
||||
0 : self.hStyles["dialogue2"],
|
||||
}
|
||||
))
|
||||
self.hRules.append((
|
||||
"{:s}(.+?){:s}".format(*self.mainConf.fmtSingleQuotes), {
|
||||
0 : self.hStyles["dialogue3"],
|
||||
}
|
||||
))
|
||||
if self.mainConf.highlightQuotes:
|
||||
self.hRules.append((
|
||||
"{:s}(.+?){:s}".format('"','"'), {
|
||||
0 : self.hStyles["dialogue1"],
|
||||
}
|
||||
))
|
||||
self.hRules.append((
|
||||
"{:s}(.+?){:s}".format(*self.mainConf.fmtDoubleQuotes), {
|
||||
0 : self.hStyles["dialogue2"],
|
||||
}
|
||||
))
|
||||
self.hRules.append((
|
||||
"{:s}(.+?){:s}".format(*self.mainConf.fmtSingleQuotes), {
|
||||
0 : self.hStyles["dialogue3"],
|
||||
}
|
||||
))
|
||||
|
||||
# Auto-Replace Tags
|
||||
self.hRules.append((
|
||||
r"<(\S+?)>", {
|
||||
0 : self.hStyles["replace"],
|
||||
|
||||
Reference in New Issue
Block a user