diff options
author | bptato <nincsnevem662@gmail.com> | 2022-11-29 22:32:38 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-11-29 22:32:52 +0100 |
commit | 6c4b7671df166bec49b1a175f759974ff5962a38 (patch) | |
tree | 3c31ced89b880df1c3870145667503bea24ee5e3 /src/io | |
parent | f2daba3542cabb4741e2dc38d1bf36a2d1564f60 (diff) | |
download | chawan-6c4b7671df166bec49b1a175f759974ff5962a38.tar.gz |
Add siteconf, fix lineedit bugs
This enables rule-based dynamic url rewriting. Also, lineedit is a bit less broken now (though it's still less than ideal.)
Diffstat (limited to 'src/io')
-rw-r--r-- | src/io/lineedit.nim | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/io/lineedit.nim b/src/io/lineedit.nim index d19fe71e..147793e1 100644 --- a/src/io/lineedit.nim +++ b/src/io/lineedit.nim @@ -115,22 +115,24 @@ proc space(edit: LineEdit, i: int) = proc generateOutput*(edit: LineEdit): FixedGrid = result = newFixedGrid(edit.promptw + edit.maxwidth) - let os = edit.news.substr(edit.shift, edit.shift + edit.displen) var x = 0 for r in edit.prompt.runes(): result[x].str &= $r x += r.lwidth() if edit.hide: - for r in os: + for r in edit.news: let w = r.lwidth() result[x].str = '*'.repeat(w) x += w if x >= result.width: break else: - for r in os: + for r in edit.news: result[x].str &= $r x += r.lwidth() if x >= result.width: break + var s = "" + for c in result: + s &= c.str proc getCursorX*(edit: LineEdit): int = return edit.promptw + edit.news.lwidth(edit.shift, edit.cursor) |