diff options
author | bptato <nincsnevem662@gmail.com> | 2022-11-20 00:25:16 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-11-20 00:25:49 +0100 |
commit | 0cfe40914404aea4df691cfb9a1f8486381268ed (patch) | |
tree | 0e0757f65448620e9d623516bb78c5703d9c72a2 /src/config | |
parent | 941f7e43b5cb7ebf6b84c3fb758ef2f1a5f641a3 (diff) | |
download | chawan-0cfe40914404aea4df691cfb9a1f8486381268ed.tar.gz |
Incremental loading of text files, etc.
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/bufferconfig.nim | 10 | ||||
-rw-r--r-- | src/config/config.nim | 2 |
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 |