Added an option to turn off syntax highlighting for text in quotes
This commit is contained in:
@@ -119,6 +119,7 @@ class Config:
|
|||||||
self.showLineEndings = False
|
self.showLineEndings = False
|
||||||
self.bigDocLimit = 800
|
self.bigDocLimit = 800
|
||||||
self.showFullPath = True
|
self.showFullPath = True
|
||||||
|
self.highlightQuotes = True
|
||||||
|
|
||||||
self.fmtApostrophe = nwUnicode.U_RSQUO
|
self.fmtApostrophe = nwUnicode.U_RSQUO
|
||||||
self.fmtSingleQuotes = [nwUnicode.U_LSQUO,nwUnicode.U_RSQUO]
|
self.fmtSingleQuotes = [nwUnicode.U_LSQUO,nwUnicode.U_RSQUO]
|
||||||
@@ -414,6 +415,9 @@ class Config:
|
|||||||
self.showFullPath = self._parseLine(
|
self.showFullPath = self._parseLine(
|
||||||
cnfParse, cnfSec, "showfullpath", self.CNF_BOOL, self.showFullPath
|
cnfParse, cnfSec, "showfullpath", self.CNF_BOOL, self.showFullPath
|
||||||
)
|
)
|
||||||
|
self.highlightQuotes = self._parseLine(
|
||||||
|
cnfParse, cnfSec, "highlightquotes", self.CNF_BOOL, self.highlightQuotes
|
||||||
|
)
|
||||||
|
|
||||||
## Backup
|
## Backup
|
||||||
cnfSec = "Backup"
|
cnfSec = "Backup"
|
||||||
@@ -504,6 +508,7 @@ class Config:
|
|||||||
cnfParse.set(cnfSec,"showlineendings", str(self.showLineEndings))
|
cnfParse.set(cnfSec,"showlineendings", str(self.showLineEndings))
|
||||||
cnfParse.set(cnfSec,"bigdoclimit", str(self.bigDocLimit))
|
cnfParse.set(cnfSec,"bigdoclimit", str(self.bigDocLimit))
|
||||||
cnfParse.set(cnfSec,"showfullpath", str(self.showFullPath))
|
cnfParse.set(cnfSec,"showfullpath", str(self.showFullPath))
|
||||||
|
cnfParse.set(cnfSec,"highlightquotes", str(self.highlightQuotes))
|
||||||
|
|
||||||
## Backup
|
## Backup
|
||||||
cnfSec = "Backup"
|
cnfSec = "Backup"
|
||||||
|
|||||||
@@ -222,6 +222,13 @@ class GuiConfigEditGeneralTab(QWidget):
|
|||||||
self.showFullPath
|
self.showFullPath
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.highlightQuotes = QSwitch()
|
||||||
|
self.highlightQuotes.setChecked(self.mainConf.highlightQuotes)
|
||||||
|
self.mainForm.addRow(
|
||||||
|
"Add highlighting to text in quotes",
|
||||||
|
self.highlightQuotes
|
||||||
|
)
|
||||||
|
|
||||||
# AutoSave Settings
|
# AutoSave Settings
|
||||||
# =================
|
# =================
|
||||||
self.mainForm.addGroupLabel("Automatic Save")
|
self.mainForm.addGroupLabel("Automatic Save")
|
||||||
@@ -296,6 +303,7 @@ class GuiConfigEditGeneralTab(QWidget):
|
|||||||
guiIcons = self.selectIcons.currentData()
|
guiIcons = self.selectIcons.currentData()
|
||||||
guiDark = self.preferDarkIcons.isChecked()
|
guiDark = self.preferDarkIcons.isChecked()
|
||||||
showFullPath = self.showFullPath.isChecked()
|
showFullPath = self.showFullPath.isChecked()
|
||||||
|
highlightQuotes = self.highlightQuotes.isChecked()
|
||||||
autoSaveDoc = self.autoSaveDoc.value()
|
autoSaveDoc = self.autoSaveDoc.value()
|
||||||
autoSaveProj = self.autoSaveProj.value()
|
autoSaveProj = self.autoSaveProj.value()
|
||||||
backupPath = self.backupPath
|
backupPath = self.backupPath
|
||||||
@@ -311,6 +319,7 @@ class GuiConfigEditGeneralTab(QWidget):
|
|||||||
self.mainConf.guiIcons = guiIcons
|
self.mainConf.guiIcons = guiIcons
|
||||||
self.mainConf.guiDark = guiDark
|
self.mainConf.guiDark = guiDark
|
||||||
self.mainConf.showFullPath = showFullPath
|
self.mainConf.showFullPath = showFullPath
|
||||||
|
self.mainConf.highlightQuotes = highlightQuotes
|
||||||
self.mainConf.autoSaveDoc = autoSaveDoc
|
self.mainConf.autoSaveDoc = autoSaveDoc
|
||||||
self.mainConf.autoSaveProj = autoSaveProj
|
self.mainConf.autoSaveProj = autoSaveProj
|
||||||
self.mainConf.backupPath = backupPath
|
self.mainConf.backupPath = backupPath
|
||||||
|
|||||||
@@ -159,22 +159,24 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
|||||||
))
|
))
|
||||||
|
|
||||||
# Quoted Strings
|
# Quoted Strings
|
||||||
self.hRules.append((
|
if self.mainConf.highlightQuotes:
|
||||||
"{:s}(.+?){:s}".format('"','"'), {
|
self.hRules.append((
|
||||||
0 : self.hStyles["dialogue1"],
|
"{:s}(.+?){:s}".format('"','"'), {
|
||||||
}
|
0 : self.hStyles["dialogue1"],
|
||||||
))
|
}
|
||||||
self.hRules.append((
|
))
|
||||||
"{:s}(.+?){:s}".format(*self.mainConf.fmtDoubleQuotes), {
|
self.hRules.append((
|
||||||
0 : self.hStyles["dialogue2"],
|
"{:s}(.+?){:s}".format(*self.mainConf.fmtDoubleQuotes), {
|
||||||
}
|
0 : self.hStyles["dialogue2"],
|
||||||
))
|
}
|
||||||
self.hRules.append((
|
))
|
||||||
"{:s}(.+?){:s}".format(*self.mainConf.fmtSingleQuotes), {
|
self.hRules.append((
|
||||||
0 : self.hStyles["dialogue3"],
|
"{:s}(.+?){:s}".format(*self.mainConf.fmtSingleQuotes), {
|
||||||
}
|
0 : self.hStyles["dialogue3"],
|
||||||
))
|
}
|
||||||
|
))
|
||||||
|
|
||||||
|
# Auto-Replace Tags
|
||||||
self.hRules.append((
|
self.hRules.append((
|
||||||
r"<(\S+?)>", {
|
r"<(\S+?)>", {
|
||||||
0 : self.hStyles["replace"],
|
0 : self.hStyles["replace"],
|
||||||
|
|||||||
Reference in New Issue
Block a user