aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/acme
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-04-19 05:54:21 +0000
committerrsc <devnull@localhost>2004-04-19 05:54:21 +0000
commit892de7987409ccd209dd4f43fb7717408d4a04bd (patch)
tree9304c5df084b72d43fdbd284cf490630c6c406b0 /src/cmd/acme
parent6b53e2a4d0d41305efa4b8b0800d119a13478ded (diff)
downloadplan9port-892de7987409ccd209dd4f43fb7717408d4a04bd.tar.gz
plan9port-892de7987409ccd209dd4f43fb7717408d4a04bd.tar.bz2
plan9port-892de7987409ccd209dd4f43fb7717408d4a04bd.zip
various little bug fixes
Diffstat (limited to 'src/cmd/acme')
-rw-r--r--src/cmd/acme/dat.h3
-rw-r--r--src/cmd/acme/exec.c11
2 files changed, 14 insertions, 0 deletions
diff --git a/src/cmd/acme/dat.h b/src/cmd/acme/dat.h
index 789ce1ca..b5c4eaf8 100644
--- a/src/cmd/acme/dat.h
+++ b/src/cmd/acme/dat.h
@@ -174,6 +174,9 @@ struct Text
uint org;
uint q0;
uint q1;
+ uint oldorg;
+ uint oldq0;
+ uint oldq1;
int what;
int tabstop;
Window *w;
diff --git a/src/cmd/acme/exec.c b/src/cmd/acme/exec.c
index 15b14670..835be5b8 100644
--- a/src/cmd/acme/exec.c
+++ b/src/cmd/acme/exec.c
@@ -580,6 +580,9 @@ get(Text *et, Text *t, Text *argt, int flag1, int _0, Rune *arg, int narg)
r = bytetorune(name, &n);
for(i=0; i<t->file->ntext; i++){
u = t->file->text[i];
+ u->oldorg = u->org;
+ u->oldq0 = u->q0;
+ u->oldq1 = u->q1;
/* second and subsequent calls with zero an already empty buffer, but OK */
textreset(u);
windirfree(u->w);
@@ -601,6 +604,14 @@ get(Text *et, Text *t, Text *argt, int flag1, int _0, Rune *arg, int narg)
t->file->unread = FALSE;
for(i=0; i<t->file->ntext; i++){
u = t->file->text[i];
+ if(u->oldorg > u->file->b.nc)
+ u->oldorg = u->file->b.nc;
+ if(u->oldq0 > u->file->b.nc)
+ u->oldq0 = u->file->b.nc;
+ if(u->oldq1 > u->file->b.nc)
+ u->oldq1 = u->file->b.nc;
+ u->org = u->oldorg;
+ textshow(u, u->oldq0, u->oldq1, 1);
textsetselect(&u->w->tag, u->w->tag.file->b.nc, u->w->tag.file->b.nc);
textscrdraw(u);
}