about summary refs log tree commit diff stats
path: root/src/config
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-07-29 22:54:51 +0200
committerbptato <nincsnevem662@gmail.com>2022-07-29 22:54:51 +0200
commit0dfe2a310db3fb7492ed448235e0757042f0f5ca (patch)
tree676aaa8d37eeaf530a53224e4463976f6b6151bb /src/config
parent54f4d71325c4f12b23113c945625796bda78e3c6 (diff)
downloadchawan-0dfe2a310db3fb7492ed448235e0757042f0f5ca.tar.gz
Increase tokenizer buffer size, add mark color option
Diffstat (limited to 'src/config')
-rw-r--r--src/config/config.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/config/config.nim b/src/config/config.nim
index 97b344e2..b35b03f5 100644
--- a/src/config/config.nim
+++ b/src/config/config.nim
@@ -4,6 +4,7 @@ import strutils
 import streams
 
 import config/toml
+import types/color
 import utils/twtstr
 
 type
@@ -44,6 +45,7 @@ type
     lemap*: ActionMap
     stylesheet*: string
     ambiguous_double*: bool
+    markcolor*: CellColor
 
 func getRealKey(key: string): string =
   var realk: string
@@ -153,6 +155,19 @@ proc parseConfig(config: var Config, dir: string, t: TomlValue) =
       else: discard
     if "inline" in css:
       config.stylesheet &= css["inline"].s
+  if "display" in t:
+    let display = t["display"]
+    if "mark-color" in display:
+      case display["mark-color"].s
+      of "black": config.markcolor = CellColor(rgb: false, color: 40u8)
+      of "red": config.markcolor = CellColor(rgb: false, color: 41u8)
+      of "green": config.markcolor = CellColor(rgb: false, color: 42u8)
+      of "yellow": config.markcolor = CellColor(rgb: false, color: 43u8)
+      of "blue": config.markcolor = CellColor(rgb: false, color: 44u8)
+      of "magenta": config.markcolor = CellColor(rgb: false, color: 45u8)
+      of "cyan": config.markcolor = CellColor(rgb: false, color: 46u8)
+      of "white": config.markcolor = CellColor(rgb: false, color: 47u8)
+      of "terminal": config.markcolor = defaultColor
 
 proc parseConfig(config: var Config, dir: string, stream: Stream) =
   config.parseConfig(dir, parseToml(stream))