diff options
author | bptato <nincsnevem662@gmail.com> | 2022-12-15 19:00:24 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-12-15 19:00:24 +0100 |
commit | 981353831d81ae7c91e67ebce1f39b144a1f9f0f (patch) | |
tree | f0fb122895eae453211e8c913da322270d2ea77c /src/render | |
parent | f0de405c6614356928d8700e2e95d00d97ffe2f9 (diff) | |
download | chawan-981353831d81ae7c91e67ebce1f39b144a1f9f0f.tar.gz |
Remove obsolete renderPlainText proc
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/rendertext.nim | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/render/rendertext.nim b/src/render/rendertext.nim index 1031f08d..6d2cf9d0 100644 --- a/src/render/rendertext.nim +++ b/src/render/rendertext.nim @@ -7,48 +7,6 @@ import encoding/decoderstream import utils/twtstr const tabwidth = 8 -proc renderPlainText*(text: string): FlexibleGrid = - var format = newFormat() - template add_format() = - if af: - af = false - result[result.high].addFormat(result[^1].str.len, format) - - result.addLine() - var spaces = 0 - var i = 0 - var af = false - while i < text.len: - case text[i] - of '\n': - add_format - result.addLine() - of '\r': discard - of '\t': - add_format - for i in 0 ..< tabwidth: - result[^1].str &= ' ' - spaces = 0 - of ' ': - add_format - result[^1].str &= ' ' - inc spaces - if spaces == 8: - spaces = 0 - of '\e': - i = format.parseAnsiCode(text, i) - af = true - elif text[i] in Controls: - add_format - result[^1].str &= '^' & text[i].getControlLetter() - else: - add_format - result[^1].str &= text[i] - inc i - - if result.len > 1 and result[^1].str.len == 0 and result[^1].formats.len == 0: - discard result.pop() - type StreamRenderer* = object spaces: int ansiparser: AnsiCodeParser |