From dfac95269ab7944810043fb9e78557b06ed3a767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20K=C3=BChl?= Date: Fri, 5 Apr 2019 18:45:56 +0000 Subject: acme: Update tag after receiving menu/nomenu control event (#251) --- src/cmd/acme/xfid.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/cmd/acme') diff --git a/src/cmd/acme/xfid.c b/src/cmd/acme/xfid.c index 5aa4a180..9c7be2c0 100644 --- a/src/cmd/acme/xfid.c +++ b/src/cmd/acme/xfid.c @@ -790,10 +790,12 @@ out: }else if(strncmp(p, "nomenu", 6) == 0){ /* turn off automatic menu */ w->filemenu = FALSE; + settag = TRUE; m = 6; }else if(strncmp(p, "menu", 4) == 0){ /* enable automatic menu */ w->filemenu = TRUE; + settag = TRUE; m = 4; }else if(strncmp(p, "cleartag", 8) == 0){ /* wipe tag right of bar */ -- cgit v1.2.3 From 3197719090b3fd0a038767f7e8e15e771b1515be Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 19 Apr 2019 22:24:53 -0400 Subject: acme: do not trim spaces during Put The commit that introduced this was pushed accidentally. It is not a good idea to do this. (It breaks programs that think that a clean window means the body matches the on-disk file.) --- src/cmd/acme/exec.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/cmd/acme') diff --git a/src/cmd/acme/exec.c b/src/cmd/acme/exec.c index 0fc6c16b..b3bb0ac3 100644 --- a/src/cmd/acme/exec.c +++ b/src/cmd/acme/exec.c @@ -192,7 +192,7 @@ execute(Text *t, uint aq0, uint aq1, int external, Text *argt) f |= 2; } aa = getbytearg(argt, TRUE, TRUE, &a); - if(a){ + if(a){ if(strlen(a) > EVENTSIZE){ /* too big; too bad */ free(r); free(aa); @@ -674,7 +674,7 @@ checksha1(char *name, File *f, Dir *d) DigestState *h; uchar out[20]; uchar *buf; - + fd = open(name, OREAD); if(fd < 0) return; @@ -700,7 +700,7 @@ trimspaces(Rune *r, uint *np, int eof) nonspace = 0; w = 0; - n = *np; + n = *np; for(i=0; ib, q, r, n); nn = n; - if(w->autoindent) + // An attempt at automatically trimming trailing spaces. + // Breaks programs that inspect body file and think it will match on-disk file + // when window is clean. Should apply the changes to the actual window instead. + // Later. + if(0 && w->autoindent) nn = trimspaces(r, &n, q+n==q1); m = snprint(s, BUFSIZE+1, "%.*S", nn, r); sha1((uchar*)s, m, nil, h); -- cgit v1.2.3