Compare commits

..

9 commits

34 changed files with 237 additions and 52 deletions

View file

@ -2,9 +2,9 @@
This is a fork of the `acme` text editor from the `plan9port` distribution. It combines the customizability of [lumar](https://github.com/lumar)/[sminez](https://github.com/sminez/plan9port)'s forks and [acme2k](https://github.com/karahobny/acme2k) with upstream fixes from [9fans](https://github.com/9fans/plan9port) and some custom work. This is a fork of the `acme` text editor from the `plan9port` distribution. It combines the customizability of [lumar](https://github.com/lumar)/[sminez](https://github.com/sminez/plan9port)'s forks and [acme2k](https://github.com/karahobny/acme2k) with upstream fixes from [9fans](https://github.com/9fans/plan9port) and some custom work.
Namely, when click-to-focus is enabled, the active window body or tag renders the tick (aka the text cursor) with the hilight color (`COLOR_<TAG|BODY>_HI`); otherwise the tick is rendered with the text color (`COLOR_<TAG|BODY>_TX`). This is all done with a fork of `libframe` which is included in the distribution and compiled into the program. Namely, when click-to-focus is enabled, the active text frame renders the tick (aka the text cursor) with the hilight color (`COLOR_<TAG|BODY>_HI`); otherwise the tick is rendered with the text color (`COLOR_<TAG|BODY>_TX`). This is all done with a fork of `libframe` which is included in the distribution and compiled into the program, and some simple logic that selects the proper ticks for each frame when the focus changes and forces a redraw.
See the `config.def.h` for out of the box customizations that can be done. See the `config.def.h` for out of the box customizations that can be done. Below is a screenshot of my typical setup (note I use compositing rules to make the window transparent, this is not in the scope of `acme` itself).
[![screenshot](./scrot.png)](./scrot.png) [![screenshot](./scrot.png)](./scrot.png)
@ -28,7 +28,7 @@ Keybindings are as follows:
- PgUp/PgDown: the obvious - PgUp/PgDown: the obvious
- Esc: cut if there is a selection, otherwise hilight the most recently edited text - Esc: cut if there is a selection, otherwise hilight the most recently edited text
Users unfamiliar with acme in general should check the following resources: Users unfamiliar with `acme` in general should check the following resources:
- [Acme: A User Interface for Programmers](http://doc.cat-v.org/plan_9/4th_edition/papers/acme/) - the definitive guide from Rob Pike - [Acme: A User Interface for Programmers](http://doc.cat-v.org/plan_9/4th_edition/papers/acme/) - the definitive guide from Rob Pike
- [A Tour of Acme](https://research.swtch.com/acme) - Russ Cox giving a tour of acme on plan9port (video) - [A Tour of Acme](https://research.swtch.com/acme) - Russ Cox giving a tour of acme on plan9port (video)
@ -37,23 +37,55 @@ Users unfamiliar with acme in general should check the following resources:
## build ## build
- Clone this repository - Clone this repository
- From the repo root, if desired, copy `config.def.h` to `config.h` and make your modifications - From the repo root, if desired, copy `config.def.h` to `config.h` and make your modifications (you will almost certainly want to change the fonts; my default primary font is Sauce Code Pro Nerd Font)
- Run `./build.sh` from the repo root. - Run `./build.sh` from the repo root.
## install ## install
After building, run `./install.sh`; If run as a regular user, it will install to `~/bin/9`; if run as root, it will overwrite the systemwide `acme` in `$PLAN9/bin` After building, run `./install.sh`; If run as a regular user, it will install to `~/bin/9`; if run as root, it will overwrite the systemwide `acme` in `$PLAN9/bin`
## TODO ## helpers
- [ ] allow active tick to be rendered for row/column tags, not just window body and tags The `scripts` directory contains some helpers, mostly just shortcuts for [acme-lsp](https://github.com/fhs/acme-lsp). Also shortcuts to change font size and a `Slide` utility (for presentations). Copy them to your `$PATH` and let 'em rip.
- [ ] compile helpers
These work only in window tags (not column or row tags):
- `F+`: increase font size
- `F-`: decrease font size
- `Slide+`: move to the next file in the current directory (alphabetical order)
- `Slide-`: move to the previous file in the current directory (alphabetical order)
- `Slide`: move to the named file in the current directory (called by the previous two)
These will work anywhere:
- `agols`: pass a colon-separated list of workspaces to start `acme-lsp` for go development
- `atsls`: pass a colon-separated list of workspaces to start `acme-lsp` for javascript/typescript development
- `acls`: pass a colon-separated list of workspaces to start `acme-lsp` for C/C++ development
- `acsls`: pass a colon-separated list of workspaces to start `acme-lsp` for C# development
For `acls` to work right with plan9port C stuff you will need to add your `$PLAN9/include` directory to the compile flags in either the project `.clangd` file or your `~/.config/clangd/config.yaml`:
```
CompileFlags:
Add:
- "-I/usr/lib/plan9/include"
```
The C# server doesn't seem to be able to handle metadata yet (eg, going to definitions that are part of the standard library or packages).
See also:
- [plumbing rules](https://nilfm.cc/git/dotfiles/tree/plumbing) - my plumbing rules, includes opening headers by right-click on the filename in an include directive
The `Toolbox` file contains a compilation of `sam` command language (`Edit` scripts) that may be useful.
## thanks ## thanks
- [rob pike](https://github.com/robpike) author of the original acme for plan9 - [rob pike](https://github.com/robpike) - author of the original `acme` for Plan9
- [russ cox](https://research.swtch.com) and the rest of the [9fans](https://github.com/9fans) for plan9port - [russ cox](https://research.swtch.com) and the rest of the [9fans](https://github.com/9fans) for [plan9port](https://github.com/9fans/plan9port)
- [lumar](https://github.com/lumar) - looks like they deleted their github repos but I originally pulled my keybinds from there - [lumar](https://github.com/lumar) - looks like they deleted their github repos but I originally pulled my keybinds from there
- [sminez](https://github.com/sminez) - possibly the original source of lumar's keybindings - [sminez](https://github.com/sminez) - possibly the original source of lumar's keybindings
- [karahobny](https://github.com/karahobny) - creator of acme2k, a big inspiration for this project - [karahobny](https://github.com/karahobny) - creator of acme2k, a big inspiration for this project
- [aksr](https://github.com/aksr) - source of the missing tag border pixel fix - [aksr](https://github.com/aksr) - source of the missing tag border pixel fix
- [chyvonomys](https://github.com/chyvonomys) - source of a few bugfixes
- [jxy](https://github.com/jxy) - source of the column drag window drift fix

9
Toolbox Normal file
View file

@ -0,0 +1,9 @@
# Compiled Edit scripts
[ Edit 1,$-1d ] # clear win
[ Edit x/^[ ]*/ a/# / ] # comment (replace # with comment prefix)
[ Edit x/^[ ]*# ?/ x/# ?/d ] # uncomment (replace # with comment prefix)
[ Edit s/^([ ][ ]|[\t]//g ] # unindent (2 spaces or tab)
[ Edit s/^/ /g ] # indent 2 spaces
[ Edit s/^/\t/g ] #indent tabs
[ Edit x/[^\n]\n[^\n]/ s/\n/ / ] # join lines

18
acme.c
View file

@ -43,7 +43,7 @@ Rune snarfrune[NSnarf + 1];
char* fontnames[2] = {PRIMARY_FONT, SECONDARY_FONT}; char* fontnames[2] = {PRIMARY_FONT, SECONDARY_FONT};
char version[] = "acme9k v9001-a02"; char version[] = "acme9k v9001-b02";
Command* command; Command* command;
@ -57,8 +57,6 @@ void derror(Display* d, char* errorstr) {
error(errorstr); error(errorstr);
} }
// we need to share this btw mainthread and mousethread
void threadmain(int argc, char* argv[]) { void threadmain(int argc, char* argv[]) {
int i; int i;
char *p, *loadfile; char *p, *loadfile;
@ -512,8 +510,7 @@ void mousethread(void* v) {
static Alt alts[NMALT + 1]; static Alt alts[NMALT + 1];
/* make sure we don't recklessly refresh the ticks */ /* make sure we don't recklessly refresh the ticks */
int click; Text* oldbarttext = nil;
Text* oldbarttext;
USED(v); USED(v);
threadsetname("mousethread"); threadsetname("mousethread");
@ -534,7 +531,6 @@ void mousethread(void* v) {
alts[NMALT].op = CHANEND; alts[NMALT].op = CHANEND;
for (;;) { for (;;) {
click = 0;
qlock(&row.lk); qlock(&row.lk);
flushwarnings(); flushwarnings();
qunlock(&row.lk); qunlock(&row.lk);
@ -646,7 +642,6 @@ void mousethread(void* v) {
} }
if (m.buttons) { if (m.buttons) {
if (w) { if (w) {
click = 1;
winlock(w, 'M'); winlock(w, 'M');
} }
t->eq0 = ~0; t->eq0 = ~0;
@ -679,8 +674,11 @@ void mousethread(void* v) {
} }
Continue: Continue:
/* won't refresh ticks if scrolling didn't change the active frame! */ /* won't refresh ticks if scrolling didn't change the active frame! */
if (oldbarttext != barttext && (m.buttons & (8 | 16) || click) && t) { if (
textsettick(t, t->row); (oldbarttext != barttext && (m.buttons & (8 | 16)) ||
m.buttons & (1 | 2 | 4)) &&
t) {
textsettick(barttext, &row);
} }
qunlock(&row.lk); qunlock(&row.lk);
break; break;
@ -991,7 +989,7 @@ Cursor2 boxcursor2 = {
0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}; 0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};
void iconinit(void) { void iconinit(void) {
Rectangle r, r1; Rectangle r;
Image* tmp; Image* tmp;
if (tagcols[BACK] == nil) { if (tagcols[BACK] == nil) {

34
cols.c
View file

@ -11,6 +11,7 @@
#include <libsec.h> #include <libsec.h>
#include "dat.h" #include "dat.h"
#include "fns.h" #include "fns.h"
#include "config.h"
static Rune Lheader[] = {'N', 'e', 'w', ' ', 'C', 'u', 't', ' ', 'P', 'a', static Rune Lheader[] = {'N', 'e', 'w', ' ', 'C', 'u', 't', ' ', 'P', 'a',
's', 't', 'e', ' ', 'S', 'n', 'a', 'r', 'f', ' ', 's', 't', 'e', ' ', 'S', 'n', 'a', 'r', 'f', ' ',
@ -24,7 +25,7 @@ void colinit(Column* c, Rectangle r) {
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
c->r = r; c->r = r;
@ -42,7 +43,7 @@ void colinit(Column* c, Rectangle r) {
draw( draw(
screen, screen,
r1, r1,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
textinsert(t, 0, Lheader, 38, TRUE); textinsert(t, 0, Lheader, 38, TRUE);
@ -124,7 +125,7 @@ Window* coladd(Column* c, Window* w, Window* clone, int y) {
draw( draw(
screen, screen,
r1, r1,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
@ -192,7 +193,7 @@ Found:
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
return; return;
@ -239,7 +240,7 @@ void colmousebut(Column* c) {
} }
void colresize(Column* c, Rectangle r) { void colresize(Column* c, Rectangle r) {
int i; int i, old, new;
Rectangle r1, r2; Rectangle r1, r2;
Window* w; Window* w;
@ -253,10 +254,12 @@ void colresize(Column* c, Rectangle r) {
draw( draw(
screen, screen,
r1, r1,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
r1.max.y = r.max.y; 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++) { for (i = 0; i < c->nw; i++) {
w = c->w[i]; w = c->w[i];
w->maxlines = 0; w->maxlines = 0;
@ -264,8 +267,9 @@ void colresize(Column* c, Rectangle r) {
r1.max.y = r.max.y; r1.max.y = r.max.y;
else { else {
r1.max.y = r1.min.y; r1.max.y = r1.min.y;
if (Dy(c->r) != 0) { if (new > 0 && old > 0 && Dy(w->r) > font->height) {
r1.max.y += (Dy(w->r) + Border) * Dy(r) / Dy(c->r); 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); r1.max.y = max(r1.max.y, r1.min.y + Border + font->height);
@ -274,7 +278,7 @@ void colresize(Column* c, Rectangle r) {
draw( draw(
screen, screen,
r2, r2,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
r1.min.y = r2.max.y; r1.min.y = r2.max.y;
@ -330,7 +334,7 @@ void colsort(Column* c) {
draw( draw(
screen, screen,
r1, r1,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
r.min.y = r1.max.y; r.min.y = r1.max.y;
@ -427,11 +431,11 @@ Pack:
if (nl[j]) if (nl[j])
r.max.y += 1 + nl[j] * v->body.fr.font->height; r.max.y += 1 + nl[j] * v->body.fr.font->height;
r.min.y = winresize(v, r, c->safe, FALSE); r.min.y = winresize(v, r, c->safe, FALSE);
r.max.y += Border; r.max.y = r.min.y + Border;
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
y1 = r.max.y; y1 = r.max.y;
@ -463,7 +467,7 @@ Pack:
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
for (j = i + 1; j < c->nw; j++) for (j = i + 1; j < c->nw; j++)
@ -485,7 +489,7 @@ Pack:
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
y1 = r.max.y; y1 = r.max.y;
@ -572,7 +576,7 @@ Found:
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
r.min.y = r.max.y; r.min.y = r.max.y;

View file

@ -25,7 +25,7 @@
/* button colors: dirty file (mod) indicator and column handles */ /* button colors: dirty file (mod) indicator and column handles */
#define COLOR_BTN_MD 0x1F9B92FF #define COLOR_BTN_MD 0x1F9B92FF
#define COLOR_BTN_CO 0x586E75FF #define COLOR_BTN_CO 0x002B36FF
/* button 2 and 3 selection colors */ /* button 2 and 3 selection colors */

View file

@ -38,7 +38,7 @@ void frselect(Frame* f, Mousectl* mc) /* when called, button 1 is down */
p0 = f->p1; p0 = f->p1;
p1 = f->p0; p1 = f->p0;
scrled = 1; 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); (*f->scroll)(f, (mp.y - f->r.max.y) / (int)f->font->height + 1);
p0 = f->p0; p0 = f->p0;
p1 = f->p1; p1 = f->p1;

Binary file not shown.

3
look.c
View file

@ -845,10 +845,11 @@ Window* openfile(Text* t, Expand* e) {
textshow(t, r.q0, r.q1, 1); textshow(t, r.q0, r.q1, 1);
winsettag(t->w); winsettag(t->w);
seltext = t; seltext = t;
if (e->jump) if (e->jump) {
moveto( moveto(
mousectl, mousectl,
addpt(frptofchar(&t->fr, t->fr.p0), Pt(4, font->height - 4))); addpt(frptofchar(&t->fr, t->fr.p0), Pt(4, font->height - 4)));
}
return w; return w;
} }

25
rows.c
View file

@ -12,6 +12,7 @@
#include <libsec.h> #include <libsec.h>
#include "dat.h" #include "dat.h"
#include "fns.h" #include "fns.h"
#include "config.h"
static Rune Lcolhdr[] = {'N', 'e', 'w', 'c', 'o', 'l', ' ', 'K', 'i', 'l', static Rune Lcolhdr[] = {'N', 'e', 'w', 'c', 'o', 'l', ' ', 'K', 'i', 'l',
'l', ' ', 'P', 'u', 't', 'a', 'l', 'l', ' ', 'D', 'l', ' ', 'P', 'u', 't', 'a', 'l', 'l', ' ', 'D',
@ -24,7 +25,7 @@ void rowinit(Row* row, Rectangle r) {
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
row->r = r; row->r = r;
@ -48,7 +49,7 @@ void rowinit(Row* row, Rectangle r) {
draw( draw(
screen, screen,
r1, r1,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
textinsert(t, 0, Lcolhdr, 29, TRUE); textinsert(t, 0, Lcolhdr, 29, TRUE);
@ -82,7 +83,7 @@ Column* rowadd(Row* row, Column* c, int x) {
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
r1 = r; r1 = r;
@ -95,7 +96,7 @@ Column* rowadd(Row* row, Column* c, int x) {
draw( draw(
screen, screen,
r1, r1,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
r.min.x = r1.max.x; r.min.x = r1.max.x;
@ -132,7 +133,7 @@ void rowresize(Row* row, Rectangle r) {
draw( draw(
screen, screen,
r1, r1,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
r.min.y = r1.max.y; r.min.y = r1.max.y;
@ -152,7 +153,7 @@ void rowresize(Row* row, Rectangle r) {
draw( draw(
screen, screen,
r2, r2,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
r1.min.x = r2.max.x; r1.min.x = r2.max.x;
@ -218,7 +219,7 @@ Found:
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
r.max.x = p.x; r.max.x = p.x;
@ -230,7 +231,7 @@ Found:
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
r.min.x = r.max.x; r.min.x = r.max.x;
@ -258,7 +259,7 @@ Found:
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
return; return;
@ -274,7 +275,7 @@ Found:
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
colresize(c, r); colresize(c, r);
@ -633,7 +634,7 @@ int rowload(Row* row, char* file, int initing) {
draw( draw(
screen, screen,
Rpt(r1.min, r2.max), Rpt(r1.min, r2.max),
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
colresize(c1, r1); colresize(c1, r1);
@ -643,7 +644,7 @@ int rowload(Row* row, char* file, int initing) {
draw( draw(
screen, screen,
r2, r2,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY),
nil, nil,
ZP); ZP);
} }

17
scripts/F+ Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
nx=1
if [ ! -z "$1" ]; then
nx=$1
fi
ctl=$(9p read acme/$winid/ctl)
set -- $ctl
size=$(echo $7 | awk -F/ '{print $5}')
size=${size%a}
newsize=$((size + nx))
newfont=$(echo $7 | sed -e s/$size/$newsize/g)
echo font ${newfont} | 9p write acme/${winid}/ctl

16
scripts/F- Executable file
View file

@ -0,0 +1,16 @@
#!/bin/sh
nx=1
if [ ! -z "$1" ]; then
nx=$1
fi
ctl=$(9p read acme/$winid/ctl)
set -- $ctl
size=$(echo $7 | awk -F/ '{print $5}')
size=${size%a}
newsize=$((size - nx))
newfont=$(echo $7 | sed -e s/$size/$newsize/g)
echo font ${newfont} | 9p write acme/${winid}/ctl

2
scripts/Lassist Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
exec L assist

2
scripts/Lcomp Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
exec L comp

2
scripts/Ldef Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
exec L def

2
scripts/Lfmt Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
exec L fmt

2
scripts/Lhov Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
exec L hov

2
scripts/Limpls Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
exec L impls

2
scripts/Lrefs Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
exec L refs

2
scripts/Lrn Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
exec L rn

2
scripts/Lsig Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
exec L sig

2
scripts/Lsyms Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
exec L syms

2
scripts/Ltype Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
exec L type

2
scripts/Lws Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
exec L ws

2
scripts/Lws+ Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
exec L ws+

2
scripts/Lws- Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
exec L ws-

5
scripts/Slide Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
echo name $(pwd)/$1 | 9p write acme/${winid}/ctl
echo clean | 9p write acme/${winid}/ctl
echo get | 9p write acme/${winid}/ctl

23
scripts/Slide+ Executable file
View file

@ -0,0 +1,23 @@
#!/bin/sh
tagdata=$(9p read acme/${winid}/tag)
set -- ${tagdata}
path=$1
slide=$(basename ${path})
oldifs=${IFS}
IFS='
'
found=0
for s in *; do
if [ ${found} -eq 1 ]; then
Slide ${s}
break;
fi
if [ "${s}" != "${slide}" ]; then
continue
else
found=1
fi
done

17
scripts/Slide- Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
tagdata=$(9p read acme/${winid}/tag)
set -- ${tagdata}
path=$1
slide=$(basename ${path})
IFS='
'
for s in *; do
if [ "${s}" != "${slide}" ]; then
newslide=${s}
else
Slide ${newslide}
break;
fi
done

7
scripts/acls Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
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}

12
scripts/acsls Executable file
View file

@ -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}

7
scripts/agols Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
if [ ! -z "$1" ]; then
workspaces="-workspaces $1"
fi
exec acme-lsp -server '([/\\]go\.mod)|([/\\]go\.sum)|(\.go)$:gopls serve' ${workspaces}

2
scripts/atsls Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
exec acme-lsp -server '(\.ts)|(\.js)|(\.jsx)|(\.tsx)$:typescript-language-server --stdio'

4
text.c
View file

@ -59,10 +59,14 @@ void textsettick(Text* t, Row* r) {
_textsettick(t, &cptr->tag); _textsettick(t, &cptr->tag);
for (wcnt = 0; wcnt < cptr->nw; wcnt++) { for (wcnt = 0; wcnt < cptr->nw; wcnt++) {
wptr = cptr->w[wcnt]; wptr = cptr->w[wcnt];
/*if (!wptr->isdir) {
winlock(wptr, 'M'); winlock(wptr, 'M');
}*/
_textsettick(t, &wptr->tag); _textsettick(t, &wptr->tag);
_textsettick(t, &wptr->body); _textsettick(t, &wptr->body);
/*if (!wptr->isdir) {
winunlock(wptr); winunlock(wptr);
}*/
} }
} }
/* force redraw to refresh all ticks; /* force redraw to refresh all ticks;

4
wind.c
View file

@ -219,6 +219,7 @@ int winresize(Window* w, Rectangle r, int safe, int keepextra) {
r1.min.y = y; r1.min.y = y;
if (!safe || !eqrect(w->body.all, r1)) { if (!safe || !eqrect(w->body.all, r1)) {
oy = y; oy = y;
if (y + 1 + w->body.fr.font->height <= r.max.y) { /* room for one line */ if (y + 1 + w->body.fr.font->height <= r.max.y) { /* room for one line */
r1.min.y = y; r1.min.y = y;
r1.max.y = y + 1; r1.max.y = y + 1;
@ -227,6 +228,7 @@ int winresize(Window* w, Rectangle r, int safe, int keepextra) {
r1.min.y = min(y, r.max.y); r1.min.y = min(y, r.max.y);
r1.max.y = r.max.y; r1.max.y = r.max.y;
} else { } else {
draw(screen, r1, textcols[BACK], nil, ZP);
r1.min.y = y; r1.min.y = y;
r1.max.y = y; r1.max.y = y;
} }
@ -574,7 +576,7 @@ void wincommit(Window* w, Text* t) {
for (i = 0; i < f->ntext; i++) for (i = 0; i < f->ntext; i++)
textcommit(f->text[i], FALSE); /* no-op for t */ textcommit(f->text[i], FALSE); /* no-op for t */
if (t->what == Body) { if (t->what == Body) {
winresize(w, w->r, TRUE, TRUE); /* winresize(w, w->r, TRUE, TRUE); */
return; return;
} }
r = parsetag(w, 0, &i); r = parsetag(w, 0, &i);