From: Michael D. Lowis Date: Sun, 12 May 2019 01:28:24 +0000 (-0400) Subject: fixed selection clearing logic to handle reverse selections correctly X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=d56e79fb492431e2fc99c0abf26b609715365d65;p=projs%2Ftide.git fixed selection clearing logic to handle reverse selections correctly --- diff --git a/TODO.md b/TODO.md index 475e3bb..37462d0 100644 --- a/TODO.md +++ b/TODO.md @@ -7,7 +7,6 @@ ## STAGING * tide: gap buffer does not handle UTF-8 currently -* tide: arrow keys on reverse selection shrink the wrong way ## BACKLOG diff --git a/src/lib/buf.c b/src/lib/buf.c index d49d70d..4a2a308 100644 --- a/src/lib/buf.c +++ b/src/lib/buf.c @@ -739,6 +739,8 @@ void buf_selln(Buf* buf) { } void buf_selclr(Buf* buf, int dir) { + if (buf->selection.beg > buf->selection.end) + buf->selection = selswap(buf->selection); if (dir > 0) buf->selection.beg = buf->selection.end; else