diff options
author | Ori Bernstein <ori@eigenstate.org> | 2020-06-06 19:05:00 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2020-06-06 19:05:00 -0700 |
commit | d2be4787c6e78df1a0fec1f6fdc75a616ecc1e1e (patch) | |
tree | 1cc9b71c9c5b634b75ce3f7edfd55fa5afefee73 /sys/src/cmd/acme/acme.c | |
parent | e46000f076b3b5389b60f4497c8b40c203202d84 (diff) |
acme: import event log from plan9port (thanks fshahriar)
Based off the following 3 commits:
4a3fb87264f8bc03fc62f00ef335056f30d18023
45f8ba54143323f08a21343633764caa59aa3ea3
fdf6ef333705c844bcf3ccf2f93b2773f1a6aa41
Reading /mnt/acme/log reports a log of window create,
put, focus, and delete events, as they happen. It blocks
until the next event is available.
Example log output:
8 new /Users/rsc/foo.go
8 put /Users/rsc/foo.go
8 del /Users/rsc/foo.go
This lets acme-aware programs react to file writes, for example
compiling code, running a test, or updating an import block.
Diffstat (limited to 'sys/src/cmd/acme/acme.c')
-rw-r--r-- | sys/src/cmd/acme/acme.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/src/cmd/acme/acme.c b/sys/src/cmd/acme/acme.c index fdc9b699e..e874d3554 100644 --- a/sys/src/cmd/acme/acme.c +++ b/sys/src/cmd/acme/acme.c @@ -258,6 +258,7 @@ readfile(Column *c, char *s) winsettag(w); textscrdraw(&w->body); textsetselect(&w->tag, w->tag.file->nc, w->tag.file->nc); + xfidlog(w, "new"); } char *oknotes[] ={ @@ -487,6 +488,12 @@ mousethread(void *) m = mousectl->Mouse; qlock(&row); t = rowwhich(&row, m.xy); + + if((t!=mousetext && t!=nil && t->w!=nil) && + (mousetext==nil || mousetext->w==nil || t->w->id!=mousetext->w->id)) { + xfidlog(t->w, "focus"); + } + if(t!=mousetext && mousetext!=nil && mousetext->w!=nil){ winlock(mousetext->w, 'M'); mousetext->eq0 = ~0; @@ -773,6 +780,7 @@ newwindowthread(void*) recvp(cnewwindow); w = makenewwindow(nil); winsettag(w); + xfidlog(w, "new"); sendp(cnewwindow, w); } } |