aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2008-03-07 07:48:08 -0500
committerRuss Cox <rsc@swtch.com>2008-03-07 07:48:08 -0500
commitfdddf6f01849a37d70b15581cd3e9713476b40ec (patch)
tree7e431579837e8422d02e68bdf21755890eba22fe /src
parent0cd1385d9f8a151fa1e42dfbac4d16d35a6056d0 (diff)
downloadplan9port-fdddf6f01849a37d70b15581cd3e9713476b40ec.tar.gz
plan9port-fdddf6f01849a37d70b15581cd3e9713476b40ec.tar.bz2
plan9port-fdddf6f01849a37d70b15581cd3e9713476b40ec.zip
acme: tag resize nits
Diffstat (limited to 'src')
-rw-r--r--src/cmd/acme/wind.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/cmd/acme/wind.c b/src/cmd/acme/wind.c
index 7f6762ad..65647099 100644
--- a/src/cmd/acme/wind.c
+++ b/src/cmd/acme/wind.c
@@ -134,10 +134,11 @@ wintaglines(Window *w, Rectangle r)
/* if tag ends with \n, include empty line at end for typing */
n = w->tag.fr.nlines;
- if(w->tag.file->b.nc > 0)
+ if(w->tag.file->b.nc > 0){
bufread(&w->tag.file->b, w->tag.file->b.nc-1, &rune, 1);
- if(rune == '\n')
- n++;
+ if(rune == '\n')
+ n++;
+ }
if(n == 0)
n = 1;
return n;
@@ -162,10 +163,8 @@ if(0) fprint(2, "winresize %d %R safe=%d keep=%d h=%d\n", w->id, r, safe, keepex
r1.max.y = min(r.max.y, r1.min.y + w->taglines*font->height);
y = r1.max.y;
mouseintag = ptinrect(mouse->xy, w->tag.all);
- if(!safe || !w->tagsafe || !eqrect(w->tag.all, r1)){
-
+ if(!safe || !w->tagsafe || !eqrect(w->tag.all, r1))
w->taglines = wintaglines(w, r);
- }
/* END TAG */
r1 = r;
@@ -182,11 +181,18 @@ if(0) fprint(2, "=> %R (%R)\n", w->tag.all, w->tag.fr.r);
windrawbutton(w);
w->tagsafe = TRUE;
/* TAG */
+ /* If mouse is in tag, pull up as tag closes. */
if(mouseintag && !ptinrect(mouse->xy, w->tag.all)){
p = mouse->xy;
p.y = w->tag.all.max.y-3;
moveto(mousectl, p);
}
+ /* If mouse is in body, push down as tag expands. */
+ if(!mouseintag && ptinrect(mouse->xy, w->tag.all)){
+ p = mouse->xy;
+ p.y = w->tag.all.max.y+3;
+ moveto(mousectl, p);
+ }
/* END TAG */
}