From a2db69c8bda889f30ea38dae5473689cde108458 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 7 Mar 2008 11:07:17 -0500 Subject: acme: revise multiline tag code --- src/cmd/acme/rows.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'src/cmd/acme/rows.c') diff --git a/src/cmd/acme/rows.c b/src/cmd/acme/rows.c index c60f4102..50990d78 100644 --- a/src/cmd/acme/rows.c +++ b/src/cmd/acme/rows.c @@ -217,8 +217,8 @@ rowclose(Row *row, Column *c, int dofree) r = c->r; if(dofree) colcloseall(c); - memmove(row->col+i, row->col+i+1, (row->ncol-i)*sizeof(Column*)); row->ncol--; + memmove(row->col+i, row->col+i+1, (row->ncol-i)*sizeof(Column*)); row->col = realloc(row->col, row->ncol*sizeof(Column*)); if(row->ncol == 0){ draw(screen, r, display->white, nil, ZP); @@ -282,17 +282,13 @@ rowtype(Row *row, Rune r, Point p) else{ winlock(w, 'K'); wintype(w, t, r); -/* - * TAG If we typed in the tag, might need to make it - * bigger to show text. \n causes tag to expand. - */ + /* Expand tag if necessary */ if(t->what == Tag){ t->w->tagsafe = FALSE; if(r == '\n') t->w->tagexpand = TRUE; winresize(w, w->r, TRUE, TRUE); } -/* END TAG */ winunlock(w); } } @@ -319,7 +315,7 @@ rowdump(Row *row, char *file) uint q0, q1; Biobuf *b; char *buf, *a, *fontname; - Rune *r, *rp; + Rune *r; Column *c; Window *w, *w1; Text *t; @@ -417,17 +413,10 @@ rowdump(Row *row, char *file) Bwrite(b, buf, strlen(buf)); m = min(RBUFSIZE, w->tag.file->b.nc); bufread(&w->tag.file->b, 0, r, m); - if(dodollarsigns && r[0] == '$'){ - rp = runestrdup(r); - expandenv(&rp, (uint*)&m); - }else - rp = r; n = 0; - while(nfile->b.nc; @@ -705,6 +694,7 @@ rowload(Row *row, char *file, int initing) Bterm(bout); free(bout); close(fd); + remove(buf); goto Rescue2; } Bputrune(bout, rune); @@ -731,7 +721,6 @@ rowload(Row *row, char *file, int initing) w->maxlines = min(w->body.fr.nlines, max(w->maxlines, w->body.fr.maxlines)); } Bterm(b); - fbuffree(buf); return TRUE; -- cgit v1.2.3