aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/acme
diff options
context:
space:
mode:
authorPetter Rodhelind <petter.rodhelind@gmail.com>2019-05-10 21:35:31 +0200
committerPetter Rodhelind <petter.rodhelind@gmail.com>2019-05-10 21:35:31 +0200
commit4a30734c4f9faa197f0a628f4b456d6dd96729a7 (patch)
treedf5f2b6ff39c8228277a9efbe941daa973902468 /src/cmd/acme
parent1bd7a82536895d5f1955603630615fb49a07a0b7 (diff)
parent3197719090b3fd0a038767f7e8e15e771b1515be (diff)
downloadplan9port-4a30734c4f9faa197f0a628f4b456d6dd96729a7.tar.gz
plan9port-4a30734c4f9faa197f0a628f4b456d6dd96729a7.tar.bz2
plan9port-4a30734c4f9faa197f0a628f4b456d6dd96729a7.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/cmd/acme')
-rw-r--r--src/cmd/acme/exec.c12
-rw-r--r--src/cmd/acme/xfid.c2
2 files changed, 10 insertions, 4 deletions
diff --git a/src/cmd/acme/exec.c b/src/cmd/acme/exec.c
index ad818505..290e0514 100644
--- a/src/cmd/acme/exec.c
+++ b/src/cmd/acme/exec.c
@@ -195,7 +195,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);
@@ -677,7 +677,7 @@ checksha1(char *name, File *f, Dir *d)
DigestState *h;
uchar out[20];
uchar *buf;
-
+
fd = open(name, OREAD);
if(fd < 0)
return;
@@ -703,7 +703,7 @@ trimspaces(Rune *r, uint *np, int eof)
nonspace = 0;
w = 0;
- n = *np;
+ n = *np;
for(i=0; i<n; i++) {
c = r[i];
if(c == '\n')
@@ -786,7 +786,11 @@ putfile(File *f, int q0, int q1, Rune *namer, int nname)
n = BUFSIZE/UTFmax;
bufread(&f->b, 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);
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 */