active tick updates propagate to column and row tags now; update readme; v9001-a03

This commit is contained in:
Iris Lightshard 2022-02-22 12:25:37 -07:00
parent ee6965098b
commit 2b1cefce23
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398
2 changed files with 8 additions and 12 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,7 +37,7 @@ 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
@ -46,13 +46,12 @@ After building, run `./install.sh`; If run as a regular user, it will install to
## TODO ## TODO
- [ ] allow active tick to be rendered for row/column tags, not just window body and tags
- [ ] compile helpers - [ ] compile helpers
## 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

7
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-a03";
Command* command; Command* command;
@ -512,7 +512,6 @@ 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; Text* oldbarttext;
USED(v); USED(v);
@ -534,7 +533,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 +644,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,7 +676,7 @@ 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 (oldbarttext != barttext && (m.buttons) && t) {
textsettick(t, t->row); textsettick(t, t->row);
} }
qunlock(&row.lk); qunlock(&row.lk);