From 366d6019831faa5eaa774e24c3dab864c21d7a29 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Wed, 14 Oct 2020 16:06:51 +0200 Subject: [PATCH 1/2] Change the strikethrough colour to the color labelled as 'hidden' --- nw/gui/dochighlight.py | 8 ++++---- nw/gui/docviewer.py | 6 +++--- nw/gui/theme.py | 4 ++-- tests/test_gui.py | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/nw/gui/dochighlight.py b/nw/gui/dochighlight.py index 564b1a9b..ff61ee23 100644 --- a/nw/gui/dochighlight.py +++ b/nw/gui/dochighlight.py @@ -68,7 +68,7 @@ class GuiDocHighlighter(QSyntaxHighlighter): self.colDialN = QColor(0, 0, 0) self.colDialD = QColor(0, 0, 0) self.colDialS = QColor(0, 0, 0) - self.colComm = QColor(0, 0, 0) + self.colHidden = QColor(0, 0, 0) self.colKey = QColor(0, 0, 0) self.colVal = QColor(0, 0, 0) self.colSpell = QColor(0, 0, 0) @@ -92,7 +92,7 @@ class GuiDocHighlighter(QSyntaxHighlighter): self.colDialN = QColor(*self.theTheme.colDialN) self.colDialD = QColor(*self.theTheme.colDialD) self.colDialS = QColor(*self.theTheme.colDialS) - self.colComm = QColor(*self.theTheme.colComm) + self.colHidden = QColor(*self.theTheme.colHidden) self.colKey = QColor(*self.theTheme.colKey) self.colVal = QColor(*self.theTheme.colVal) self.colSpell = QColor(*self.theTheme.colSpell) @@ -118,14 +118,14 @@ class GuiDocHighlighter(QSyntaxHighlighter): "header4h" : self._makeFormat(self.colHeadH, "bold", 1.2), "bold" : self._makeFormat(self.colEmph, "bold"), "italic" : self._makeFormat(self.colEmph, "italic"), - "strike" : self._makeFormat(self.colEmph, "strike"), + "strike" : self._makeFormat(self.colHidden, "strike"), "trailing" : self._makeFormat(self.colTrail, "background"), "nobreak" : self._makeFormat(self.colTrail, "background"), "dialogue1" : self._makeFormat(self.colDialN), "dialogue2" : self._makeFormat(self.colDialD), "dialogue3" : self._makeFormat(self.colDialS), "replace" : self._makeFormat(self.colRepTag), - "hidden" : self._makeFormat(self.colComm), + "hidden" : self._makeFormat(self.colHidden), "keyword" : self._makeFormat(self.colKey), "modifier" : self._makeFormat(self.colMod), "value" : self._makeFormat(self.colVal, "underline"), diff --git a/nw/gui/docviewer.py b/nw/gui/docviewer.py index 2d9ac637..39a769b3 100644 --- a/nw/gui/docviewer.py +++ b/nw/gui/docviewer.py @@ -532,9 +532,9 @@ class GuiDocViewer(QTextBrowser): hColR = self.theTheme.colHead[0], hColG = self.theTheme.colHead[1], hColB = self.theTheme.colHead[2], - cColR = self.theTheme.colComm[0], - cColG = self.theTheme.colComm[1], - cColB = self.theTheme.colComm[2], + cColR = self.theTheme.colHidden[0], + cColG = self.theTheme.colHidden[1], + cColB = self.theTheme.colHidden[2], eColR = self.theTheme.colEmph[0], eColG = self.theTheme.colEmph[1], eColB = self.theTheme.colEmph[2], diff --git a/nw/gui/theme.py b/nw/gui/theme.py index 88cdd72f..5683d1a3 100644 --- a/nw/gui/theme.py +++ b/nw/gui/theme.py @@ -103,7 +103,7 @@ class GuiTheme: self.colDialN = [0, 0, 0] self.colDialD = [0, 0, 0] self.colDialS = [0, 0, 0] - self.colComm = [0, 0, 0] + self.colHidden = [0, 0, 0] self.colKey = [0, 0, 0] self.colVal = [0, 0, 0] self.colSpell = [0, 0, 0] @@ -356,7 +356,7 @@ class GuiTheme: self.colDialN = self._loadColour(confParser, cnfSec, "straightquotes") self.colDialD = self._loadColour(confParser, cnfSec, "doublequotes") self.colDialS = self._loadColour(confParser, cnfSec, "singlequotes") - self.colComm = self._loadColour(confParser, cnfSec, "hidden") + self.colHidden = self._loadColour(confParser, cnfSec, "hidden") self.colKey = self._loadColour(confParser, cnfSec, "keyword") self.colVal = self._loadColour(confParser, cnfSec, "value") self.colSpell = self._loadColour(confParser, cnfSec, "spellcheckline") diff --git a/tests/test_gui.py b/tests/test_gui.py index 4afaaa2b..ea7b54ec 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -1484,7 +1484,7 @@ def testThemes(qtbot, yesToAll, nwMinimal, nwTemp): assert nwGUI.theTheme.colDialN == [242, 119, 122] assert nwGUI.theTheme.colDialD == [153, 204, 153] assert nwGUI.theTheme.colDialS == [255, 204, 102] - assert nwGUI.theTheme.colComm == [153, 153, 153] + assert nwGUI.theTheme.colHidden == [153, 153, 153] assert nwGUI.theTheme.colKey == [242, 119, 122] assert nwGUI.theTheme.colVal == [204, 153, 204] assert nwGUI.theTheme.colSpell == [242, 119, 122] From 1a0f37fa452d8862f28754e663b60766368915fe Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Wed, 14 Oct 2020 18:13:42 +0200 Subject: [PATCH 2/2] Rename the regex constants --- nw/constants/constants.py | 4 ++-- nw/core/tokenizer.py | 4 ++-- nw/gui/dochighlight.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nw/constants/constants.py b/nw/constants/constants.py index 9a539b73..e7549bb4 100644 --- a/nw/constants/constants.py +++ b/nw/constants/constants.py @@ -41,8 +41,8 @@ class nwConst(): class nwRegEx(): - FMT_I = r"(?