diff options
author | Russ Cox <rsc@swtch.com> | 2009-07-15 02:11:02 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2009-07-15 02:11:02 -0400 |
commit | cb92a1b41c1e5bd0686866c123304df47e8cca6a (patch) | |
tree | 7e8e7c9842d47c9b43e5dcf174dd1ca4369e16fd /src/cmd | |
parent | e6c837d612cc884aa4fe68335c121c3dadddeebc (diff) | |
download | plan9port-cb92a1b41c1e5bd0686866c123304df47e8cca6a.tar.gz plan9port-cb92a1b41c1e5bd0686866c123304df47e8cca6a.tar.bz2 plan9port-cb92a1b41c1e5bd0686866c123304df47e8cca6a.zip |
acme: do not redraw body on every tag change
fixes #5
http://bitbucket.org/rsc/plan9port/issue/5/
http://groups.google.com/group/plan9port-dev/t/e679347ecaa05cff
http://codereview.appspot.com/95041
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/acme/text.c | 5 | ||||
-rw-r--r-- | src/cmd/acme/wind.c | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/cmd/acme/text.c b/src/cmd/acme/text.c index 30f5804d..f330d4b8 100644 --- a/src/cmd/acme/text.c +++ b/src/cmd/acme/text.c @@ -46,7 +46,8 @@ textredraw(Text *t, Rectangle r, Font *f, Image *b, int odx) frinit(&t->fr, r, f, b, t->fr.cols); rr = t->fr.r; rr.min.x -= Scrollwid+Scrollgap; /* back fill to scroll bar */ - draw(t->fr.b, rr, t->fr.cols[BACK], nil, ZP); + if(!t->fr.noredraw) + draw(t->fr.b, rr, t->fr.cols[BACK], nil, ZP); /* use no wider than 3-space tabs in a directory */ maxt = maxtab; if(t->what == Body){ @@ -85,7 +86,7 @@ textresize(Text *t, Rectangle r, int keepextra) r.min.x += Scrollwid+Scrollgap; frclear(&t->fr, 0); textredraw(t, r, t->fr.font, t->fr.b, odx); - if(keepextra && t->fr.r.max.y < t->all.max.y){ + if(keepextra && t->fr.r.max.y < t->all.max.y && !t->fr.noredraw){ /* draw background in bottom fringe of window */ r.min.x -= Scrollgap; r.min.y = t->fr.r.max.y; diff --git a/src/cmd/acme/wind.c b/src/cmd/acme/wind.c index 70a4edec..bfe4beca 100644 --- a/src/cmd/acme/wind.c +++ b/src/cmd/acme/wind.c @@ -190,7 +190,7 @@ winresize(Window *w, Rectangle r, int safe, int keepextra) /* If needed, resize & redraw body. */ r1 = r; r1.min.y = y; - if(tagresized || !safe || !eqrect(w->body.all, r1)){ + if(!safe || !eqrect(w->body.all, r1)){ oy = y; if(y+1+w->body.fr.font->height <= r.max.y){ /* room for one line */ r1.min.y = y; |