commit 2d2c69ea629dff17573f7c935c4453e7a0058e80
parent 15ef103d51643ca3fea4ca5b795d49c5b269925d
Author: Giygas <none>
Date: Mon, 30 Dec 2024 05:06:46 +0100
ESC key warps cursor to highlighted text
Diffstat:
M | patch-acme3k | | | 53 | +++++++++++++++++++++++++++++++++++------------------ |
1 file changed, 35 insertions(+), 18 deletions(-)
diff --git a/patch-acme3k b/patch-acme3k
@@ -1,6 +1,6 @@
diff -u a/src/cmd/acme/acme.c b/src/cmd/acme/acme.c
---- a/src/cmd/acme/acme.c Sun Nov 10 21:20:26 2024
-+++ b/src/cmd/acme/acme.c Sun Nov 10 21:19:53 2024
+--- a/src/cmd/acme/acme.c Mon Dec 30 04:46:36 2024
++++ b/src/cmd/acme/acme.c Mon Dec 30 04:40:45 2024
@@ -11,6 +11,7 @@
#include <libsec.h>
#include "dat.h"
@@ -86,8 +86,8 @@ diff -u a/src/cmd/acme/acme.c b/src/cmd/acme/acme.c
/*
diff -u a/src/cmd/acme/cols.c b/src/cmd/acme/cols.c
---- a/src/cmd/acme/cols.c Sun Nov 10 21:20:26 2024
-+++ b/src/cmd/acme/cols.c Sun Nov 10 21:19:53 2024
+--- a/src/cmd/acme/cols.c Mon Dec 30 04:46:36 2024
++++ b/src/cmd/acme/cols.c Mon Dec 30 04:40:45 2024
@@ -29,7 +29,7 @@
Rectangle r1;
Text *t;
@@ -190,8 +190,8 @@ diff -u a/src/cmd/acme/cols.c b/src/cmd/acme/cols.c
Only in b/src/cmd/acme: config.def.h
Only in b/src/cmd/acme: config.h
diff -u a/src/cmd/acme/dat.h b/src/cmd/acme/dat.h
---- a/src/cmd/acme/dat.h Sun Nov 10 21:20:26 2024
-+++ b/src/cmd/acme/dat.h Sun Nov 10 21:19:53 2024
+--- a/src/cmd/acme/dat.h Mon Dec 30 04:46:36 2024
++++ b/src/cmd/acme/dat.h Mon Dec 30 04:40:45 2024
@@ -222,7 +222,7 @@
void textscroll(Text*, int);
void textselect(Text*);
@@ -222,8 +222,8 @@ diff -u a/src/cmd/acme/dat.h b/src/cmd/acme/dat.h
int erroutfd;
Common subdirectories: a/src/cmd/acme/mail and b/src/cmd/acme/mail
diff -u a/src/cmd/acme/rows.c b/src/cmd/acme/rows.c
---- a/src/cmd/acme/rows.c Sun Nov 10 21:20:26 2024
-+++ b/src/cmd/acme/rows.c Sun Nov 10 21:19:54 2024
+--- a/src/cmd/acme/rows.c Mon Dec 30 04:46:37 2024
++++ b/src/cmd/acme/rows.c Mon Dec 30 04:40:45 2024
@@ -28,7 +28,7 @@
Rectangle r1;
Text *t;
@@ -329,8 +329,8 @@ diff -u a/src/cmd/acme/rows.c b/src/cmd/acme/rows.c
if(i >= row->ncol)
rowadd(row, nil, x);
diff -u a/src/cmd/acme/text.c b/src/cmd/acme/text.c
---- a/src/cmd/acme/text.c Sun Nov 10 21:20:26 2024
-+++ b/src/cmd/acme/text.c Sun Nov 10 21:19:54 2024
+--- a/src/cmd/acme/text.c Mon Dec 30 04:46:37 2024
++++ b/src/cmd/acme/text.c Mon Dec 30 04:48:09 2024
@@ -694,8 +694,21 @@
case Kdown:
if(t->what == Tag)
@@ -376,7 +376,23 @@ diff -u a/src/cmd/acme/text.c b/src/cmd/acme/text.c
case Kscrolloneup:
if(t->what == Tag)
goto Tagup;
-@@ -1258,7 +1281,7 @@
+@@ -835,10 +858,13 @@
+ break; /* fall through to normal insertion case */
+ case 0x1B:
+ if(t->eq0 != ~0) {
+- if(t->eq0 <= t->q0)
++ if(t->eq0 <= t->q0) {
+ textsetselect(t, t->eq0, t->q0);
+- else
++ moveto(mousectl, addpt(frptofchar(&t->fr, t->eq0), Pt(4, t->fr.font->height-4)));
++ } else {
+ textsetselect(t, t->q0, t->eq0);
++ moveto(mousectl, addpt(frptofchar(&t->fr, t->q0), Pt(4, t->fr.font->height-4)));
++ }
+ }
+ if(t->ncache > 0)
+ typecommit(t);
+@@ -1258,7 +1284,7 @@
};
uint
@@ -385,7 +401,7 @@ diff -u a/src/cmd/acme/text.c b/src/cmd/acme/text.c
{
uint p0, p1, q, tmp;
ulong msec;
-@@ -1291,12 +1314,12 @@
+@@ -1291,12 +1317,12 @@
pt1 = pt0;
reg = region(q, p0);
if(reg == 0)
@@ -400,7 +416,7 @@ diff -u a/src/cmd/acme/text.c b/src/cmd/acme/text.c
else if(q < p1)
selrestore(f, qt, q, p1);
-@@ -1304,7 +1327,7 @@
+@@ -1304,7 +1330,7 @@
if(q > p1)
selrestore(f, pt1, p1, q);
else
@@ -409,7 +425,7 @@ diff -u a/src/cmd/acme/text.c b/src/cmd/acme/text.c
}
p1 = q;
pt1 = qt;
-@@ -1341,12 +1364,12 @@
+@@ -1341,12 +1367,12 @@
}
int
@@ -424,7 +440,7 @@ diff -u a/src/cmd/acme/text.c b/src/cmd/acme/text.c
buts = mousectl->m.buttons;
if((buts & mask) == 0){
*q0 = p0+t->org;
-@@ -1364,7 +1387,7 @@
+@@ -1364,7 +1390,7 @@
int buts;
*tp = nil;
@@ -433,7 +449,7 @@ diff -u a/src/cmd/acme/text.c b/src/cmd/acme/text.c
if(buts & 4)
return 0;
if(buts & 1){ /* pick up argument */
-@@ -1379,7 +1402,7 @@
+@@ -1379,7 +1405,7 @@
{
int h;
@@ -442,9 +458,10 @@ diff -u a/src/cmd/acme/text.c b/src/cmd/acme/text.c
return h;
}
+Only in b/src/cmd/acme: tfile
diff -u a/src/cmd/acme/wind.c b/src/cmd/acme/wind.c
---- a/src/cmd/acme/wind.c Sun Nov 10 21:20:26 2024
-+++ b/src/cmd/acme/wind.c Sun Nov 10 21:19:54 2024
+--- a/src/cmd/acme/wind.c Mon Dec 30 04:46:37 2024
++++ b/src/cmd/acme/wind.c Mon Dec 30 04:40:46 2024
@@ -235,7 +235,6 @@
r1.min.y = min(y, r.max.y);
r1.max.y = r.max.y;