aboutsummaryrefslogtreecommitdiffstats
path: root/src/config
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-20 23:26:54 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-20 23:26:54 +0100
commit7eee2e1f8c87232b13e68dc3ac398e8fd76ea5f9 (patch)
treeee6f6682bcfd6e6e0a5c70d5e341380cc4c54110 /src/config
parent18350159ad39c25d8acf6d9abdc4084592d58a21 (diff)
downloadchawan-7eee2e1f8c87232b13e68dc3ac398e8fd76ea5f9.tar.gz
pager: proxy values in container; js: bugfixes
Also, a little bonus: w3m keybindings
Diffstat (limited to 'src/config')
-rw-r--r--src/config/config.nim18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/config/config.nim b/src/config/config.nim
index 7ed1441a..d3cad0b1 100644
--- a/src/config/config.nim
+++ b/src/config/config.nim
@@ -53,12 +53,13 @@ type
Config* = ref ConfigObj
ConfigObj* = object
+ searchwrap* {.jsget, jsset.}: bool
maxredirect*: int
- prependhttps*: bool
+ prependhttps* {.jsget, jsset.}: bool
termreload*: bool
nmap*: ActionMap
lemap*: ActionMap
- stylesheet*: string
+ stylesheet* {.jsget, jsset.}: string
startup*: string
ambiguous_double*: bool
hlcolor*: RGBAColor
@@ -254,15 +255,20 @@ proc parseConfig(config: Config, dir: string, t: TomlValue) =
of "include":
if v.vt == VALUE_STRING:
when nimvm:
- config.loadConfig(v.s)
+ config.parseConfig(dir, staticRead(dir / v.s))
else:
- config.loadConfig(v.s)
+ config.parseConfig(dir, newFileStream(dir / v.s))
elif t.vt == VALUE_ARRAY:
for v in t.a:
when nimvm:
- config.parseConfig(parentDir(v.s), staticRead(v.s))
+ config.parseConfig(dir, staticRead(dir / v.s))
else:
- config.parseConfig(parentDir(v.s), newFileStream(v.s))
+ config.parseConfig(dir, newFileStream(dir / v.s))
+ of "search":
+ for k, v in v:
+ case k
+ of "wrap":
+ config.searchwrap = v.b
of "start":
for k, v in v:
case k