From ca7ae6b66633da8ff32a07f98e554722b360d3ad Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Mon, 29 Jan 2024 17:45:53 +0100 Subject: [PATCH] Add a syntax colour for optional values --- novelwriter/assets/syntax/default_dark.conf | 1 + novelwriter/assets/syntax/default_light.conf | 1 + novelwriter/assets/syntax/grey_dark.conf | 1 + novelwriter/assets/syntax/grey_light.conf | 1 + novelwriter/assets/syntax/light_owl.conf | 1 + novelwriter/assets/syntax/night_owl.conf | 1 + novelwriter/assets/syntax/solarized_dark.conf | 1 + novelwriter/assets/syntax/solarized_light.conf | 1 + novelwriter/assets/syntax/tomorrow.conf | 1 + novelwriter/assets/syntax/tomorrow_night.conf | 1 + novelwriter/assets/syntax/tomorrow_night_blue.conf | 1 + novelwriter/assets/syntax/tomorrow_night_bright.conf | 1 + novelwriter/assets/syntax/tomorrow_night_eighties.conf | 1 + novelwriter/gui/theme.py | 2 ++ 14 files changed, 15 insertions(+) diff --git a/novelwriter/assets/syntax/default_dark.conf b/novelwriter/assets/syntax/default_dark.conf index 77dc829e..2743b91a 100644 --- a/novelwriter/assets/syntax/default_dark.conf +++ b/novelwriter/assets/syntax/default_dark.conf @@ -20,6 +20,7 @@ hidden = 150, 150, 150 shortcode = 0, 155, 200 keyword = 200, 46, 0 value = 184, 200, 0 +optional = 0, 155, 200 spellcheckline = 200, 46, 0 errorline = 46, 200, 0 replacetag = 0, 184, 46 diff --git a/novelwriter/assets/syntax/default_light.conf b/novelwriter/assets/syntax/default_light.conf index b4eab626..eff5c4a8 100644 --- a/novelwriter/assets/syntax/default_light.conf +++ b/novelwriter/assets/syntax/default_light.conf @@ -20,6 +20,7 @@ hidden = 100, 100, 100 shortcode = 0, 100, 0 keyword = 200, 50, 50 value = 50, 150, 50 +optional = 0, 100, 0 spellcheckline = 200, 0, 0 errorline = 0, 150, 0 replacetag = 0, 150, 0 diff --git a/novelwriter/assets/syntax/grey_dark.conf b/novelwriter/assets/syntax/grey_dark.conf index ed09963f..b1e2081c 100644 --- a/novelwriter/assets/syntax/grey_dark.conf +++ b/novelwriter/assets/syntax/grey_dark.conf @@ -20,6 +20,7 @@ hidden = 150, 150, 150 shortcode = 225, 225, 225 keyword = 225, 225, 225 value = 200, 200, 200 +optional = 225, 225, 225 spellcheckline = 200, 46, 0 errorline = 46, 200, 0 replacetag = 225, 225, 225 diff --git a/novelwriter/assets/syntax/grey_light.conf b/novelwriter/assets/syntax/grey_light.conf index e2ca0666..06f43522 100644 --- a/novelwriter/assets/syntax/grey_light.conf +++ b/novelwriter/assets/syntax/grey_light.conf @@ -20,6 +20,7 @@ hidden = 100, 100, 100 shortcode = 0, 0, 0 keyword = 0, 0, 0 value = 20, 20, 20 +optional = 0, 0, 0 spellcheckline = 200, 0, 0 errorline = 0, 150, 0 replacetag = 0, 0, 0 diff --git a/novelwriter/assets/syntax/light_owl.conf b/novelwriter/assets/syntax/light_owl.conf index c42b3155..63723094 100644 --- a/novelwriter/assets/syntax/light_owl.conf +++ b/novelwriter/assets/syntax/light_owl.conf @@ -40,6 +40,7 @@ hidden = 152, 159, 177 shortcode = 40, 142, 215 keyword = 222, 61, 58 value = 150, 74, 193 +optional = 40, 142, 215 spellcheckline = 222, 61, 58 errorline = 8, 145, 106 replacetag = 42, 162, 152 diff --git a/novelwriter/assets/syntax/night_owl.conf b/novelwriter/assets/syntax/night_owl.conf index 2ee057e3..6d817ef5 100644 --- a/novelwriter/assets/syntax/night_owl.conf +++ b/novelwriter/assets/syntax/night_owl.conf @@ -40,6 +40,7 @@ hidden = 99, 119, 119 shortcode = 130, 170, 255 keyword = 247, 140, 108 value = 199, 146, 234 +optional = 130, 170, 255 spellcheckline = 247, 140, 108 errorline = 173, 219, 103 replacetag = 127, 219, 202 diff --git a/novelwriter/assets/syntax/solarized_dark.conf b/novelwriter/assets/syntax/solarized_dark.conf index ef34ddf4..9b473923 100644 --- a/novelwriter/assets/syntax/solarized_dark.conf +++ b/novelwriter/assets/syntax/solarized_dark.conf @@ -20,6 +20,7 @@ hidden = 147, 161, 161 shortcode = 147, 161, 161 keyword = 133, 153, 0 value = 203, 75, 22 +optional = 147, 161, 161 spellcheckline = 203, 75, 22 errorline = 220, 50, 47 replacetag = 133, 153, 0 diff --git a/novelwriter/assets/syntax/solarized_light.conf b/novelwriter/assets/syntax/solarized_light.conf index 21a31ade..c94a30fc 100644 --- a/novelwriter/assets/syntax/solarized_light.conf +++ b/novelwriter/assets/syntax/solarized_light.conf @@ -20,6 +20,7 @@ hidden = 88, 110, 117 shortcode = 88, 110, 117 keyword = 133, 153, 0 value = 203, 75, 22 +optional = 88, 110, 117 spellcheckline = 203, 75, 22 errorline = 220, 50, 47 replacetag = 133, 153, 0 diff --git a/novelwriter/assets/syntax/tomorrow.conf b/novelwriter/assets/syntax/tomorrow.conf index 20430fcd..aa16138a 100644 --- a/novelwriter/assets/syntax/tomorrow.conf +++ b/novelwriter/assets/syntax/tomorrow.conf @@ -40,6 +40,7 @@ hidden = 142, 144, 140 shortcode = 66, 113, 174 keyword = 240, 40, 41 value = 137, 89, 168 +optional = 66, 113, 174 spellcheckline = 240, 40, 41 errorline = 113, 140, 0 replacetag = 62, 153, 159 diff --git a/novelwriter/assets/syntax/tomorrow_night.conf b/novelwriter/assets/syntax/tomorrow_night.conf index 97c217df..af951937 100644 --- a/novelwriter/assets/syntax/tomorrow_night.conf +++ b/novelwriter/assets/syntax/tomorrow_night.conf @@ -40,6 +40,7 @@ hidden = 150, 152, 150 shortcode = 129, 162, 190 keyword = 204, 102, 102 value = 178, 148, 187 +optional = 129, 162, 190 spellcheckline = 204, 102, 102 errorline = 181, 189, 104 replacetag = 138, 190, 183 diff --git a/novelwriter/assets/syntax/tomorrow_night_blue.conf b/novelwriter/assets/syntax/tomorrow_night_blue.conf index 18c930e7..939dc146 100644 --- a/novelwriter/assets/syntax/tomorrow_night_blue.conf +++ b/novelwriter/assets/syntax/tomorrow_night_blue.conf @@ -40,6 +40,7 @@ hidden = 114, 133, 183 shortcode = 187, 218, 255 keyword = 255, 157, 164 value = 235, 187, 255 +optional = 187, 218, 255 spellcheckline = 255, 157, 164 errorline = 209, 241, 169 replacetag = 153, 255, 255 diff --git a/novelwriter/assets/syntax/tomorrow_night_bright.conf b/novelwriter/assets/syntax/tomorrow_night_bright.conf index b7bf5658..d3005072 100644 --- a/novelwriter/assets/syntax/tomorrow_night_bright.conf +++ b/novelwriter/assets/syntax/tomorrow_night_bright.conf @@ -40,6 +40,7 @@ hidden = 150, 152, 150 shortcode = 122, 166, 218 keyword = 213, 78, 83 value = 195, 151, 216 +optional = 122, 166, 218 spellcheckline = 213, 78, 83 errorline = 185, 202, 74 replacetag = 112, 192, 177 diff --git a/novelwriter/assets/syntax/tomorrow_night_eighties.conf b/novelwriter/assets/syntax/tomorrow_night_eighties.conf index 29dbecc5..7773a9df 100644 --- a/novelwriter/assets/syntax/tomorrow_night_eighties.conf +++ b/novelwriter/assets/syntax/tomorrow_night_eighties.conf @@ -40,6 +40,7 @@ hidden = 153, 153, 153 shortcode = 102, 153, 204 keyword = 242, 119, 122 value = 204, 153, 204 +optional = 102, 153, 204 spellcheckline = 242, 119, 122 errorline = 153, 204, 153 replacetag = 102, 204, 204 diff --git a/novelwriter/gui/theme.py b/novelwriter/gui/theme.py index 144228c3..aa6f9d12 100644 --- a/novelwriter/gui/theme.py +++ b/novelwriter/gui/theme.py @@ -101,6 +101,7 @@ class GuiTheme: self.colCode = QColor(0, 0, 0) self.colKey = QColor(0, 0, 0) self.colVal = QColor(0, 0, 0) + self.colOpt = QColor(0, 0, 0) self.colSpell = QColor(0, 0, 0) self.colError = QColor(0, 0, 0) self.colRepTag = QColor(0, 0, 0) @@ -323,6 +324,7 @@ class GuiTheme: self.colCode = self._parseColour(confParser, cnfSec, "shortcode") self.colKey = self._parseColour(confParser, cnfSec, "keyword") self.colVal = self._parseColour(confParser, cnfSec, "value") + self.colOpt = self._parseColour(confParser, cnfSec, "optional") self.colSpell = self._parseColour(confParser, cnfSec, "spellcheckline") self.colError = self._parseColour(confParser, cnfSec, "errorline") self.colRepTag = self._parseColour(confParser, cnfSec, "replacetag")