Compare commits

..

No commits in common. "main" and "activetick" have entirely different histories.

34 changed files with 52 additions and 237 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 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. 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.
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). See the `config.def.h` for out of the box customizations that can be done.
[![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,55 +37,23 @@ 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 (you will almost certainly want to change the fonts; my default primary font is Sauce Code Pro Nerd Font) - From the repo root, if desired, copy `config.def.h` to `config.h` and make your modifications
- 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`
## helpers ## TODO
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. - [ ] allow active tick to be rendered for row/column tags, not just window body and tags
- [ ] 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](https://github.com/9fans/plan9port) - [russ cox](https://research.swtch.com) and the rest of the [9fans](https://github.com/9fans) for 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

View file

@ -1,9 +0,0 @@
# 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-b02"; char version[] = "acme9k v9001-a02";
Command* command; Command* command;
@ -57,6 +57,8 @@ 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;
@ -510,7 +512,8 @@ 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 */
Text* oldbarttext = nil; int click;
Text* oldbarttext;
USED(v); USED(v);
threadsetname("mousethread"); threadsetname("mousethread");
@ -531,6 +534,7 @@ 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);
@ -642,6 +646,7 @@ 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;
@ -674,11 +679,8 @@ 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 ( if (oldbarttext != barttext && (m.buttons & (8 | 16) || click) && t) {
(oldbarttext != barttext && (m.buttons & (8 | 16)) || textsettick(t, t->row);
m.buttons & (1 | 2 | 4)) &&
t) {
textsettick(barttext, &row);
} }
qunlock(&row.lk); qunlock(&row.lk);
break; break;
@ -989,7 +991,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; Rectangle r, r1;
Image* tmp; Image* tmp;
if (tagcols[BACK] == nil) { if (tagcols[BACK] == nil) {

34
cols.c
View file

@ -11,7 +11,6 @@
#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', ' ',
@ -25,7 +24,7 @@ void colinit(Column* c, Rectangle r) {
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
c->r = r; c->r = r;
@ -43,7 +42,7 @@ void colinit(Column* c, Rectangle r) {
draw( draw(
screen, screen,
r1, r1,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
textinsert(t, 0, Lheader, 38, TRUE); textinsert(t, 0, Lheader, 38, TRUE);
@ -125,7 +124,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, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
@ -193,7 +192,7 @@ Found:
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
return; return;
@ -240,7 +239,7 @@ void colmousebut(Column* c) {
} }
void colresize(Column* c, Rectangle r) { void colresize(Column* c, Rectangle r) {
int i, old, new; int i;
Rectangle r1, r2; Rectangle r1, r2;
Window* w; Window* w;
@ -254,12 +253,10 @@ void colresize(Column* c, Rectangle r) {
draw( draw(
screen, screen,
r1, r1,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
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;
@ -267,9 +264,8 @@ 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 (new > 0 && old > 0 && Dy(w->r) > font->height) { if (Dy(c->r) != 0) {
r1.max.y += r1.max.y += (Dy(w->r) + Border) * Dy(r) / Dy(c->r);
(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);
@ -278,7 +274,7 @@ void colresize(Column* c, Rectangle r) {
draw( draw(
screen, screen,
r2, r2,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
r1.min.y = r2.max.y; r1.min.y = r2.max.y;
@ -334,7 +330,7 @@ void colsort(Column* c) {
draw( draw(
screen, screen,
r1, r1,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
r.min.y = r1.max.y; r.min.y = r1.max.y;
@ -431,11 +427,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 = r.min.y + Border; r.max.y += Border;
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
y1 = r.max.y; y1 = r.max.y;
@ -467,7 +463,7 @@ Pack:
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
for (j = i + 1; j < c->nw; j++) for (j = i + 1; j < c->nw; j++)
@ -489,7 +485,7 @@ Pack:
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
y1 = r.max.y; y1 = r.max.y;
@ -576,7 +572,7 @@ Found:
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
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 0x002B36FF #define COLOR_BTN_CO 0x586E75FF
/* 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 - 1) { } else if (mp.y > f->r.max.y) {
(*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;

BIN
libframe/libframe.a Normal file

Binary file not shown.

3
look.c
View file

@ -845,11 +845,10 @@ 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,7 +12,6 @@
#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',
@ -25,7 +24,7 @@ void rowinit(Row* row, Rectangle r) {
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
row->r = r; row->r = r;
@ -49,7 +48,7 @@ void rowinit(Row* row, Rectangle r) {
draw( draw(
screen, screen,
r1, r1,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
textinsert(t, 0, Lcolhdr, 29, TRUE); textinsert(t, 0, Lcolhdr, 29, TRUE);
@ -83,7 +82,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, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
r1 = r; r1 = r;
@ -96,7 +95,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, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
r.min.x = r1.max.x; r.min.x = r1.max.x;
@ -133,7 +132,7 @@ void rowresize(Row* row, Rectangle r) {
draw( draw(
screen, screen,
r1, r1,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
r.min.y = r1.max.y; r.min.y = r1.max.y;
@ -153,7 +152,7 @@ void rowresize(Row* row, Rectangle r) {
draw( draw(
screen, screen,
r2, r2,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
r1.min.x = r2.max.x; r1.min.x = r2.max.x;
@ -219,7 +218,7 @@ Found:
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
r.max.x = p.x; r.max.x = p.x;
@ -231,7 +230,7 @@ Found:
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
r.min.x = r.max.x; r.min.x = r.max.x;
@ -259,7 +258,7 @@ Found:
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
return; return;
@ -275,7 +274,7 @@ Found:
draw( draw(
screen, screen,
r, r,
allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
colresize(c, r); colresize(c, r);
@ -634,7 +633,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, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
colresize(c1, r1); colresize(c1, r1);
@ -644,7 +643,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, COLOR_EMPTY), allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0x222222FF),
nil, nil,
ZP); ZP);
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

4
text.c
View file

@ -59,14 +59,10 @@ 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,7 +219,6 @@ 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;
@ -228,7 +227,6 @@ 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;
} }
@ -576,7 +574,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);