aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Stevens <nilix@nilfm.cc>2022-03-26 10:03:39 -0600
committerDerek Stevens <nilix@nilfm.cc>2022-03-26 10:03:39 -0600
commite7e3183672f6befcc0979994b29f9bc4ecf2785a (patch)
treef0473e3b4788be5749ce1084ce4e71af00f8064b
parent232d3e06f6262c5c6e2aa015bfa0b6cae3047555 (diff)
import upstream bugfixes from chyvonomys, jxy, and knieriem; v9001-a05
-rw-r--r--Toolbox2
-rw-r--r--acme.c2
-rw-r--r--cols.c11
-rw-r--r--libframe/frselect.c2
-rwxr-xr-xscripts/acls8
-rwxr-xr-xscripts/acsls12
-rwxr-xr-xscripts/agols7
7 files changed, 34 insertions, 10 deletions
diff --git a/Toolbox b/Toolbox
index dc46c58..fa03e3c 100644
--- a/Toolbox
+++ b/Toolbox
@@ -3,6 +3,6 @@
[ Edit 1,$-1d ] # clear win
[ Edit x/^[ ]*/ a/# / ] # comment (replace # with comment prefix)
[ Edit x/^[ ]*# ?/ x/# ?/d ] # uncomment (replace # with comment prefix)
-[ Edit s/^[ ]//g ] # unindent
+[ Edit s/^[ ][ ]//g ] # unindent
[ Edit s/^/ /g ] # indent
[ Edit x/[^\n]\n[^\n]/ s/\n/ / ] # join lines \ No newline at end of file
diff --git a/acme.c b/acme.c
index a98492c..0373dbc 100644
--- a/acme.c
+++ b/acme.c
@@ -43,7 +43,7 @@ Rune snarfrune[NSnarf + 1];
char* fontnames[2] = {PRIMARY_FONT, SECONDARY_FONT};
-char version[] = "acme9k v9001-a04";
+char version[] = "acme9k v9001-a05";
Command* command;
diff --git a/cols.c b/cols.c
index eb17cc8..72559fc 100644
--- a/cols.c
+++ b/cols.c
@@ -240,7 +240,7 @@ void colmousebut(Column* c) {
}
void colresize(Column* c, Rectangle r) {
- int i;
+ int i, old, new;
Rectangle r1, r2;
Window* w;
@@ -258,6 +258,8 @@ void colresize(Column* c, Rectangle r) {
nil,
ZP);
r1.max.y = r.max.y;
+ new = Dy(r) - c->nw*(Border + font->height);
+ old = Dy(c->r) - c->nw * (Border + font->height);
for (i = 0; i < c->nw; i++) {
w = c->w[i];
w->maxlines = 0;
@@ -265,8 +267,9 @@ void colresize(Column* c, Rectangle r) {
r1.max.y = r.max.y;
else {
r1.max.y = r1.min.y;
- if (Dy(c->r) != 0) {
- r1.max.y += (Dy(w->r) + Border) * Dy(r) / Dy(c->r);
+ if (new > 0 && old > 0 && Dy(w->r) > font->height) {
+ r1.max.y +=
+ (Dy(w->r) - font->height) * new / old + Border + font->height;
}
}
r1.max.y = max(r1.max.y, r1.min.y + Border + font->height);
@@ -428,7 +431,7 @@ Pack:
if (nl[j])
r.max.y += 1 + nl[j] * v->body.fr.font->height;
r.min.y = winresize(v, r, c->safe, FALSE);
- r.max.y += Border;
+ r.max.y += r.min.y + Border;
draw(
screen,
r,
diff --git a/libframe/frselect.c b/libframe/frselect.c
index 24c7be3..009f30e 100644
--- a/libframe/frselect.c
+++ b/libframe/frselect.c
@@ -38,7 +38,7 @@ void frselect(Frame* f, Mousectl* mc) /* when called, button 1 is down */
p0 = f->p1;
p1 = f->p0;
scrled = 1;
- } else if (mp.y > f->r.max.y) {
+ } else if (mp.y >= f->r.max.y - 1) {
(*f->scroll)(f, (mp.y - f->r.max.y) / (int)f->font->height + 1);
p0 = f->p0;
p1 = f->p1;
diff --git a/scripts/acls b/scripts/acls
index e47fa5c..581c1da 100755
--- a/scripts/acls
+++ b/scripts/acls
@@ -1,3 +1,7 @@
#!/bin/sh
-export CFLAGS="-I${PLAN9}/include"
-exec acme-lsp -server '(\.c)|(\.h)|(\.cc)|(\.hh)|(\.cpp)|(\.hpp)$:clangd -log=error --background-index --limit-results=500 --completion-style=bundled' \ No newline at end of file
+
+if [ ! -z "$1" ]; then
+ workspaces="-workspaces $1"
+fi
+
+exec acme-lsp -server '(\.c)|(\.h)|(\.cc)|(\.hh)|(\.cpp)|(\.hpp)$:clangd -log=error --background-index --limit-results=500 --completion-style=bundled' ${workspaces} \ No newline at end of file
diff --git a/scripts/acsls b/scripts/acsls
new file mode 100755
index 0000000..684d148
--- /dev/null
+++ b/scripts/acsls
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+if [ -z "$1" ]; then
+ :
+elif [ -z "$2" ]; then
+ workspaces="-workspaces $1"
+else
+ workspaces="-workspaces $2"
+ sln="--solution $1"
+fi
+
+exec acme-lsp --server "(\.cs)|(\.sln)|(\.csproj)$:csharp-ls ${sln}" ${workspaces} \ No newline at end of file
diff --git a/scripts/agols b/scripts/agols
index 350c81b..85047e7 100755
--- a/scripts/agols
+++ b/scripts/agols
@@ -1,2 +1,7 @@
#!/bin/sh
-exec acme-lsp -server '([/\\]go\.mod)|([/\\]go\.sum)|(\.go)$:gopls serve' -workspaces $@ \ No newline at end of file
+
+if [ ! -z "$1" ]; then
+ workspaces="-workspaces $1"
+fi
+
+exec acme-lsp -server '([/\\]go\.mod)|([/\\]go\.sum)|(\.go)$:gopls serve' ${workspaces} \ No newline at end of file