shithub: orca

Download patch

ref: 934e1926d5e4d6298a93794abc29484c88191df1
parent: 6dacf8b7555f69dccc5eb3fbcc5078a478925e6a
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Mon Feb 17 06:36:58 EST 2020

plan9: fix selection sliding

--- a/plan9.c
+++ b/plan9.c
@@ -662,22 +662,22 @@
 	if (sel.min.x+x < 0 || sel.min.x >= field.width || sel.min.y+y < 0 || sel.min.y+y >= field.height)
 		return;
 
-	field_resize_raw(&selfield, Dy(sel), Dx(sel));
+	field_resize_raw(&selfield, Dy(sel)+1, Dx(sel)+1);
 	gbuffer_copy_subrect(
 		field.buffer, selfield.buffer,
-		field.height, field.width, Dy(sel), Dx(sel),
-		sel.min.x, sel.min.y, 0, 0, Dy(sel), Dx(sel)
+		field.height, field.width, Dy(sel)+1, Dx(sel)+1,
+		sel.min.y, sel.min.x, 0, 0, Dy(sel)+1, Dx(sel)+1
 	);
 
-	for (i = sel.min.y; i < sel.max.y; i++) {
-		fieldsetn(sel.min.x, i, '.', Dx(sel));
-		memset(&mbuf.buffer[sel.min.x + field.width*i], 0, Dx(sel));
+	for (i = sel.min.y; i <= sel.max.y; i++) {
+		fieldsetn(sel.min.x, i, '.', Dx(sel)+1);
+		memset(&mbuf.buffer[sel.min.x + field.width*i], 0, Dx(sel)+1);
 	}
 
 	gbuffer_copy_subrect(
 		selfield.buffer, field.buffer,
-		Dy(sel), Dx(sel), field.height, field.width,
-		0, 0, sel.min.y+y, sel.min.x+x, Dy(sel), Dx(sel)
+		Dy(sel)+1, Dx(sel)+1, field.height, field.width,
+		0, 0, sel.min.y+y, sel.min.x+x, Dy(sel)+1, Dx(sel)+1
 	);
 }