diff options
author | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2020-01-19 18:36:50 +0100 |
---|---|---|
committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2020-01-19 18:36:50 +0100 |
commit | b099753597d2c3b3d150c686df5c16310168477e (patch) | |
tree | 9937982e026137675bed3690f32143572b4a5d83 /sys/src/cmd/acme | |
parent | 639500b7487174176e315c25499cfabdd4a4af3c (diff) |
acme: Restore call to movetodel() in colclose
Diffstat (limited to 'sys/src/cmd/acme')
-rw-r--r-- | sys/src/cmd/acme/cols.c | 13 | ||||
-rw-r--r-- | sys/src/cmd/acme/fns.h | 3 | ||||
-rw-r--r-- | sys/src/cmd/acme/util.c | 10 |
3 files changed, 20 insertions, 6 deletions
diff --git a/sys/src/cmd/acme/cols.c b/sys/src/cmd/acme/cols.c index f66634d57..c5c3ee35e 100644 --- a/sys/src/cmd/acme/cols.c +++ b/sys/src/cmd/acme/cols.c @@ -112,7 +112,7 @@ void colclose(Column *c, Window *w, int dofree) { Rectangle r; - int i; + int i, didmouse, up; /* w is locked */ if(!c->safe) @@ -126,7 +126,7 @@ colclose(Column *c, Window *w, int dofree) w->tag.col = nil; w->body.col = nil; w->col = nil; - restoremouse(w); + didmouse = restoremouse(w); if(dofree){ windelete(w); winclose(w); @@ -138,17 +138,24 @@ colclose(Column *c, Window *w, int dofree) draw(screen, r, display->white, nil, ZP); return; } + up = 0; if(i == c->nw){ /* extend last window down */ w = c->w[i-1]; r.min.y = w->r.min.y; r.max.y = c->r.max.y; }else{ /* extend next window up */ + up = 1; w = c->w[i]; r.max.y = w->r.max.y; } draw(screen, r, textcols[BACK], nil, ZP); - if(c->safe) + if(c->safe) { + if(!didmouse && up) + w->showdel = TRUE; winresize(w, r, FALSE); + if(!didmouse && up) + movetodel(w); + } } void diff --git a/sys/src/cmd/acme/fns.h b/sys/src/cmd/acme/fns.h index 021799c4b..2a2508087 100644 --- a/sys/src/cmd/acme/fns.h +++ b/sys/src/cmd/acme/fns.h @@ -19,10 +19,11 @@ void undo(Text*, Text*, Text*, int, int, Rune*, int); char* getname(Text*, Text*, Rune*, int, int); void scrsleep(uint); void savemouse(Window*); -void restoremouse(Window*); +int restoremouse(Window*); void clearmouse(void); void allwindows(void(*)(Window*, void*), void*); uint loadfile(int, uint, int*, int(*)(void*, uint, Rune*, int), void*); +void movetodel(Window*); Window* errorwin(Mntdir*, int); Window* errorwinforwin(Window*); diff --git a/sys/src/cmd/acme/util.c b/sys/src/cmd/acme/util.c index bf00a9e65..44f77192e 100644 --- a/sys/src/cmd/acme/util.c +++ b/sys/src/cmd/acme/util.c @@ -367,12 +367,18 @@ savemouse(Window *w) mousew = w; } -void +int restoremouse(Window *w) { - if(mousew!=nil && mousew==w) + int did; + + did = 0; + if(mousew!=nil && mousew==w) { moveto(mousectl, prevmouse); + did = 1; + } mousew = nil; + return did; } void |