diff options
author | bptato <nincsnevem662@gmail.com> | 2022-07-12 18:12:55 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-07-12 18:12:55 +0200 |
commit | 2f0ea08df1e6884da51ea510cc352395e853cfc0 (patch) | |
tree | 214aef273f772a8ad657039097cb7c9134ba9f7d /src/io/buffer.nim | |
parent | 1abd3aadf0c999c6e26ba4e7910b5abe3510c6c2 (diff) | |
download | chawan-2f0ea08df1e6884da51ea510cc352395e853cfc0.tar.gz |
Fix a tokenizer bug, clean up some warnings
Diffstat (limited to 'src/io/buffer.nim')
-rw-r--r-- | src/io/buffer.nim | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/src/io/buffer.nim b/src/io/buffer.nim index 7dc59777..44e5855c 100644 --- a/src/io/buffer.nim +++ b/src/io/buffer.nim @@ -329,26 +329,6 @@ proc refreshDisplay(buffer: Buffer) = inc y -proc setCursorXB(buffer: Buffer, byte: int) = - var w = 0 - var b = 0 - while b < byte: - var r: Rune - fastRuneAt(buffer.currentLine, b, r) - w += r.width() - - let x = w - if x - buffer.fromx >= 0 and x - buffer.width < buffer.fromx: - buffer.cursorx = x - else: - if x > buffer.cursorx: - buffer.fromx = max(x - buffer.width + 1, 0) - elif x < buffer.cursorx: - buffer.fromx = min(x, buffer.maxfromx) - buffer.cursorx = x - buffer.redraw = true - buffer.xend = buffer.cursorx - proc setCursorX(buffer: Buffer, x: int, refresh = true, save = true) = if (not refresh) or (buffer.fromx <= x and x < buffer.fromx + buffer.width): buffer.cursorx = x @@ -391,10 +371,6 @@ proc setFromXY*(buffer: Buffer, x, y: int) = buffer.fromy = max(min(y, buffer.maxfromy), 0) buffer.fromx = max(min(x, buffer.maxfromx), 0) -proc setCursorXBY(buffer: Buffer, x, y: int) = - buffer.setCursorY(y) - buffer.setCursorXB(x) - proc cursorDown*(buffer: Buffer) = if buffer.cursory < buffer.numLines - 1: buffer.setCursorY(buffer.cursory + 1) @@ -955,11 +931,11 @@ proc submitForm(form: HTMLFormElement, submitter: Element): Option[ClickAction] assert formmethod == FORM_METHOD_POST HttpPost - let target = if submitter.isSubmitButton() and submitter.attrb("formtarget"): - submitter.attr("formtarget") - else: - submitter.target() - let noopener = true #TODO + #let target = if submitter.isSubmitButton() and submitter.attrb("formtarget"): + # submitter.attr("formtarget") + #else: + # submitter.target() + #let noopener = true #TODO template mutateActionUrl() = let query = serializeApplicationXWWFormUrlEncoded(entrylist) |