diff options
author | bptato <nincsnevem662@gmail.com> | 2021-11-15 19:47:52 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2021-11-15 19:47:52 +0100 |
commit | c391881cb73ba265388dd9834b399d57633d0b36 (patch) | |
tree | 4c7514f45ab8d94e86c566cba7f65a664fe65678 /src | |
parent | dc70358d994894ba707e0fb42660036eba603d38 (diff) | |
download | chawan-c391881cb73ba265388dd9834b399d57633d0b36.tar.gz |
Try to output as little as possible with reshape
Diffstat (limited to 'src')
-rw-r--r-- | src/io/buffer.nim | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/io/buffer.nim b/src/io/buffer.nim index 0f83fe99..bd37ef91 100644 --- a/src/io/buffer.nim +++ b/src/io/buffer.nim @@ -83,17 +83,14 @@ func generateSwapOutput*(buffer: Buffer): string = let prev = buffer.prevdisplay var x = 0 var y = 0 - var cx = 0 - var cy = 0 + var cx = -1 + var cy = -1 var i = 0 var text = "" while i < max: if x >= buffer.width: x = 0 - cx = 0 - text &= '\n' inc y - inc cy if curr[i] != prev[i]: let currwidth = curr[i].runes.width() @@ -683,9 +680,6 @@ proc renderDocument*(buffer: Buffer) = for line in inline.content: #eprint line buffer.setRowBox(line) - else: - discard - #eprint "BLOCK h", box.height var i = box.children.len - 1 while i >= 0: @@ -729,7 +723,6 @@ proc statusMsgForBuffer(buffer: Buffer) = buffer.setStatusMessage(msg) proc displayBufferSwapOutput(buffer: Buffer) = - termGoto(0, 0) print(buffer.generateSwapOutput()) proc displayBuffer(buffer: Buffer) = @@ -814,7 +807,6 @@ proc inputLoop(attrs: TermAttributes, buffer: Buffer): bool = of ACTION_RELOAD: return true of ACTION_RESHAPE: buffer.reshape = true - buffer.redraw = true of ACTION_REDRAW: buffer.redraw = true of ACTION_TOGGLE_SOURCE: buffer.showsource = not buffer.showsource @@ -837,11 +829,8 @@ proc inputLoop(attrs: TermAttributes, buffer: Buffer): bool = if buffer.reshape: buffer.reshapeBuffer() buffer.reshape = false - buffer.redraw = true #? - if buffer.redraw: buffer.refreshDisplay() buffer.displayBufferSwapOutput() - buffer.redraw = false if not nostatus: buffer.statusMsgForBuffer() |