diff options
author | bptato <nincsnevem662@gmail.com> | 2021-08-08 21:01:47 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2021-08-08 21:01:47 +0200 |
commit | d7cb6d7d610df886d028ca6d6aecf3d9a3ba54ff (patch) | |
tree | 5eb75d8b95ed9e6eab1e7f3d72b8afd1adc0e283 /src/io | |
parent | fa4560f63e38886b2b7541642b9aa1656dc40508 (diff) | |
download | chawan-d7cb6d7d610df886d028ca6d6aecf3d9a3ba54ff.tar.gz |
Implement CSS display none in box renderer etc.
Other changes being bugfixes and a temporary implementation of "view source"
Diffstat (limited to 'src/io')
-rw-r--r-- | src/io/buffer.nim | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/io/buffer.nim b/src/io/buffer.nim index f3fbbd38..a33c88ff 100644 --- a/src/io/buffer.nim +++ b/src/io/buffer.nim @@ -73,6 +73,8 @@ type displaycontrols*: bool redraw*: bool location*: Uri + source*: string #TODO + showsource*: bool func newBuffer*(attrs: TermAttributes): Buffer = new(result) @@ -783,6 +785,13 @@ proc inputLoop(attrs: TermAttributes, buffer: Buffer): bool = reshape = true redraw = true of ACTION_REDRAW: redraw = true + of ACTION_TOGGLE_SOURCE: + buffer.showsource = not buffer.showsource + if buffer.showsource: + buffer.renderPlainText(buffer.source) + else: + buffer.renderDocument() + redraw = true else: discard stdout.hideCursor() |