~rabbits/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH left] selection: stop cell selection from reseting back to 0

Details
Message ID
<20210109054801.8214-1-zachdecook@librem.one>
DKIM signature
missing
Download raw message
Patch: +4 -3
---
 left.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/left.c b/left.c
index ee8a29d..f50cfb1 100644
--- a/left.c
+++ b/left.c
@@ -149,7 +149,7 @@ getcell(int x, int y)
		} else
			col++;
	}
	return 0;
	return -1;
}

int
@@ -334,8 +334,9 @@ setscroll(int v)
void
setselection(int from, int to)
{
	sel.from = clamp(from, 0, doc.len);
	sel.to = to < from ? from : clamp(to, 0, doc.len);
	if(from == -1) return;
	sel.from = clamp(from, 0, doc.len - 1);
	sel.to = to < from ? from : clamp(to, 0, doc.len - 1);
	if(getrow(sel.to) - sel.scroll > VER - 1)
		setscroll(getrow(sel.to) - VER + 1);
	if(getrow(sel.from) - sel.scroll < 0)
-- 
2.29.2
Reply to thread Export thread (mbox)