shithub: riscv

Download patch

ref: 2f300614acc7ba886cdd5d650aa58366309e9f83
parent: d998b7013538f1bc31a933be0d35e10bf6d89b1e
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Fri Mar 28 09:34:25 EDT 2025

rio: include delimiter-pair when extending selection

--- a/sys/src/cmd/rio/wind.c
+++ b/sys/src/cmd/rio/wind.c
@@ -1089,9 +1089,24 @@
 static void
 wstretchsel(Window *w, uint pt, uint *q0, uint *q1, int mode)
 {
-	int c, i;
+	int c, i, rc, lc;
 	Rune *r, *l, *p;
 	uint q;
+
+	if(mode){
+		lc = *q0 > 0     ? w->r[*q0-1] : '\n';
+		rc = *q1 < w->nr ? w->r[*q1]   : '\n';
+		for(i=0; left[i]; i++){
+			l = left[i];
+			r = right[i];
+			p = strrune(l, lc);
+			if(p && r[p-l] == rc){
+				*q0 -= lc != '\n';
+				(*q1)++;
+				return;
+			}
+		}
+	}
 
 	*q0 = pt;
 	*q1 = pt;
--