diff options
author | bptato <nincsnevem662@gmail.com> | 2022-12-07 15:03:37 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-12-07 15:03:37 +0100 |
commit | eb61a176754a565a5c53562993897388fa2d260c (patch) | |
tree | 7c35d5415d71ec92092bc99efa7d00f4cfdaadc3 | |
parent | 38838a5fc3a3ba52982dc005013a7cca80f8c927 (diff) | |
download | chawan-eb61a176754a565a5c53562993897388fa2d260c.tar.gz |
Add force-clear
-rw-r--r-- | res/config.toml | 1 | ||||
-rw-r--r-- | src/config/config.nim | 2 | ||||
-rw-r--r-- | src/display/term.nim | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/res/config.toml b/res/config.toml index 15f4aadf..6115303b 100644 --- a/res/config.toml +++ b/res/config.toml @@ -9,6 +9,7 @@ alt-screen = "auto" highlight-color = "cyan" double-width-ambiguous = false minimum-contrast = 100 +force-clear = false [[siteconf]] url = '^ddg:' diff --git a/src/config/config.nim b/src/config/config.nim index 4db66283..941f8c54 100644 --- a/src/config/config.nim +++ b/src/config/config.nim @@ -42,6 +42,7 @@ type editor*: string tmpdir*: string siteconf: seq[StaticSiteConfig] + forceclear*: bool BufferConfig* = object userstyle*: string @@ -207,6 +208,7 @@ proc parseConfig(config: Config, dir: string, t: TomlValue) = config.mincontrast = float(v.i) else: config.mincontrast = float(v.f) + of "force-clear": config.forceclear = v.b of "external": for k, v in v: case k diff --git a/src/display/term.nim b/src/display/term.nim index 899cd561..eb061d99 100644 --- a/src/display/term.nim +++ b/src/display/term.nim @@ -339,7 +339,7 @@ proc writeGrid*(term: Terminal, grid: FixedGrid, x = 0, y = 0) = proc outputGrid*(term: Terminal) = term.outfile.write(term.resetFormat()) - if not term.cleared: + if term.config.forceclear or not term.cleared: term.outfile.write(term.generateFullOutput(term.canvas)) term.cleared = true else: |