tacme: do not redraw body on every tag change - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit cb92a1b41c1e5bd0686866c123304df47e8cca6a
 (DIR) parent e6c837d612cc884aa4fe68335c121c3dadddeebc
 (HTM) Author: Russ Cox <rsc@swtch.com>
       Date:   Wed, 15 Jul 2009 02:11:02 -0400
       
       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:
         M src/cmd/acme/text.c                 |       5 +++--
         M src/cmd/acme/wind.c                 |       2 +-
       
       2 files changed, 4 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git a/src/cmd/acme/text.c b/src/cmd/acme/text.c
       t@@ -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){
       t@@ -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;
 (DIR) diff --git a/src/cmd/acme/wind.c b/src/cmd/acme/wind.c
       t@@ -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;