diff options
author | bptato <nincsnevem662@gmail.com> | 2021-12-05 20:02:02 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2021-12-05 20:02:02 +0100 |
commit | 458f713fd4e506df0b916bb436c2d19fc6557e02 (patch) | |
tree | 25bde336b7834e3d9f89ddaa9f750294580c05d9 /src/io | |
parent | 31117cad22df103f84cfbe97dff08debcde72a66 (diff) | |
download | chawan-458f713fd4e506df0b916bb436c2d19fc6557e02.tar.gz |
Avoid negative fromx
Diffstat (limited to 'src/io')
-rw-r--r-- | src/io/buffer.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/io/buffer.nim b/src/io/buffer.nim index 18e4a3d6..893f66a9 100644 --- a/src/io/buffer.nim +++ b/src/io/buffer.nim @@ -350,7 +350,7 @@ proc cursorLeft*(buffer: Buffer) = elif buffer.cursorx > 0: buffer.cursorx = max(0, cellorigin - 1) if buffer.fromx > buffer.cursorx - (buffer.cell().ow - 1): - buffer.fromx = buffer.cursorx - max(0, buffer.cell().ow - 1) + buffer.fromx = max(buffer.cursorx - max(0, buffer.cell().ow - 1), 0) buffer.redraw = true buffer.xend = buffer.cursorx |