From 37f8ed2410ad5cbd46eda00a77f8bf4950bcf544 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sun, 23 Sep 2012 22:01:56 -0400 Subject: acme: mouse movement for Del If the mouse was in the tag of the old window, it was most likely pointing at Del. If bringing up a new window from below and not moving the mouse somewhere else, adjust it so that it ends up pointing at Del in the replacement window's tag too. This makes it easy to Del a sequence of windows in a column, from top to bottom. http://www.youtube.com/watch?v=ET8w6RT6u5M R=r http://codereview.appspot.com/6558047 --- src/cmd/acme/util.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/cmd/acme/util.c') diff --git a/src/cmd/acme/util.c b/src/cmd/acme/util.c index 7675346a..de6cdf8c 100644 --- a/src/cmd/acme/util.c +++ b/src/cmd/acme/util.c @@ -383,12 +383,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 -- cgit v1.2.3