about summary refs log tree commit diff stats
path: root/src/config
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-11-20 00:25:16 +0100
committerbptato <nincsnevem662@gmail.com>2022-11-20 00:25:49 +0100
commit0cfe40914404aea4df691cfb9a1f8486381268ed (patch)
tree0e0757f65448620e9d623516bb78c5703d9c72a2 /src/config
parent941f7e43b5cb7ebf6b84c3fb758ef2f1a5f641a3 (diff)
downloadchawan-0cfe40914404aea4df691cfb9a1f8486381268ed.tar.gz
Incremental loading of text files, etc.
Diffstat (limited to 'src/config')
-rw-r--r--src/config/bufferconfig.nim10
-rw-r--r--src/config/config.nim2
2 files changed, 11 insertions, 1 deletions
diff --git a/src/config/bufferconfig.nim b/src/config/bufferconfig.nim
new file mode 100644
index 00000000..984df24e
--- /dev/null
+++ b/src/config/bufferconfig.nim
@@ -0,0 +1,10 @@
+import config/config
+import css/sheet
+
+type BufferConfig* = ref object
+  userstyle*: CSSStylesheet
+
+proc loadBufferConfig*(config: Config): BufferConfig =
+  new(result)
+  result.userstyle = parseStylesheet(config.stylesheet)
+  zeroMem(addr config[], sizeof(ConfigObj))
diff --git a/src/config/config.nim b/src/config/config.nim
index 9db896e5..a97be9cd 100644
--- a/src/config/config.nim
+++ b/src/config/config.nim
@@ -9,7 +9,7 @@ import utils/twtstr
 type
   ActionMap = Table[string, string]
   Config* = ref ConfigObj
-  ConfigObj = object
+  ConfigObj* = object
     nmap*: ActionMap
     lemap*: ActionMap
     stylesheet*: string