commit 15ef103d51643ca3fea4ca5b795d49c5b269925d
parent 5e0efae3326c6e4fbc545cab16d5b8fb8678f239
Author: Giygas <none>
Date: Sun, 10 Nov 2024 21:23:09 +0100
Up-arrow, down-arrow to navigate lines
Diffstat:
M | patch-acme3k | | | 83 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------- |
1 file changed, 65 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 Wed Nov 6 11:26:32 2024
-+++ b/src/cmd/acme/acme.c Wed Nov 6 11:24:49 2024
+--- 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
@@ -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 Wed Nov 6 11:26:32 2024
-+++ b/src/cmd/acme/cols.c Wed Nov 6 11:24:49 2024
+--- 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
@@ -29,7 +29,7 @@
Rectangle r1;
Text *t;
@@ -187,9 +187,11 @@ diff -u a/src/cmd/acme/cols.c b/src/cmd/acme/cols.c
r.min.y = r.max.y;
if(i == c->nw-1)
r.max.y = c->r.max.y;
+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 Wed Nov 6 11:26:32 2024
-+++ b/src/cmd/acme/dat.h Wed Nov 6 11:24:49 2024
+--- 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
@@ -222,7 +222,7 @@
void textscroll(Text*, int);
void textselect(Text*);
@@ -220,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 Wed Nov 6 11:26:32 2024
-+++ b/src/cmd/acme/rows.c Wed Nov 6 11:24:49 2024
+--- 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
@@ -28,7 +28,7 @@
Rectangle r1;
Text *t;
@@ -327,9 +329,54 @@ 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 Wed Nov 6 11:26:32 2024
-+++ b/src/cmd/acme/text.c Wed Nov 6 11:24:49 2024
-@@ -1258,7 +1258,7 @@
+--- 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
+@@ -694,8 +694,21 @@
+ case Kdown:
+ if(t->what == Tag)
+ goto Tagdown;
+- n = t->fr.maxlines/3;
+- goto case_Down;
++ typecommit(t);
++
++ nb = n = 0;
++ if ((nb = textbswidth(t, 0x15)) == 1) /* beginning of line */
++ nb = 0;
++ for (q0 = t->q0; q0 < t->file->b.nc && textreadc(t, q0) != '\n'; q0++)
++ ;
++ while (++q0 < t->file->b.nc && textreadc(t, q0) != '\n')
++ if (n++ == nb)
++ break;
++ q0 = q0 > t->file->b.nc ? t->file->b.nc : q0;
++
++ textshow(t, q0, q0, TRUE);
++ return;
++
+ case Kscrollonedown:
+ if(t->what == Tag)
+ goto Tagdown;
+@@ -712,8 +725,18 @@
+ case Kup:
+ if(t->what == Tag)
+ goto Tagup;
+- n = t->fr.maxlines/3;
+- goto case_Up;
++ typecommit(t);
++
++ nb = nnb = 0;
++ for (q0 = t->q0; q0 > 0 && textreadc(t, q0-1) != '\n'; q0--)
++ nb++;
++ if (q0 > 0)
++ for (--q0; q0 > 0 && textreadc(t, q0-1) != '\n'; q0--)
++ nnb++;
++ nb = nb > nnb ? nnb : nb;
++ textshow(t, q0 + nb, q0 + nb, TRUE);
++
++ return;
+ case Kscrolloneup:
+ if(t->what == Tag)
+ goto Tagup;
+@@ -1258,7 +1281,7 @@
};
uint
@@ -338,7 +385,7 @@ diff -u a/src/cmd/acme/text.c b/src/cmd/acme/text.c
{
uint p0, p1, q, tmp;
ulong msec;
-@@ -1291,12 +1291,12 @@
+@@ -1291,12 +1314,12 @@
pt1 = pt0;
reg = region(q, p0);
if(reg == 0)
@@ -353,7 +400,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 +1304,7 @@
+@@ -1304,7 +1327,7 @@
if(q > p1)
selrestore(f, pt1, p1, q);
else
@@ -362,7 +409,7 @@ diff -u a/src/cmd/acme/text.c b/src/cmd/acme/text.c
}
p1 = q;
pt1 = qt;
-@@ -1341,12 +1341,12 @@
+@@ -1341,12 +1364,12 @@
}
int
@@ -377,7 +424,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 +1364,7 @@
+@@ -1364,7 +1387,7 @@
int buts;
*tp = nil;
@@ -386,7 +433,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 +1379,7 @@
+@@ -1379,7 +1402,7 @@
{
int h;
@@ -396,8 +443,8 @@ diff -u a/src/cmd/acme/text.c b/src/cmd/acme/text.c
}
diff -u a/src/cmd/acme/wind.c b/src/cmd/acme/wind.c
---- a/src/cmd/acme/wind.c Wed Nov 6 11:26:32 2024
-+++ b/src/cmd/acme/wind.c Wed Nov 6 11:24:49 2024
+--- 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
@@ -235,7 +235,6 @@
r1.min.y = min(y, r.max.y);
r1.max.y = r.max.y;