aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/acme/text.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-12-27 01:16:26 +0000
committerrsc <devnull@localhost>2004-12-27 01:16:26 +0000
commit6d7fdb243ca2611e31648d57c8b3ac4101407cfa (patch)
treec06f6a7764885fd4b4d15eb776c77fb4fc505b0b /src/cmd/acme/text.c
parent334cb1e91ceb2d667c1cfd0b71aa9801bef089ec (diff)
downloadplan9port-6d7fdb243ca2611e31648d57c8b3ac4101407cfa.tar.gz
plan9port-6d7fdb243ca2611e31648d57c8b3ac4101407cfa.tar.bz2
plan9port-6d7fdb243ca2611e31648d57c8b3ac4101407cfa.zip
changes from plan 9
Diffstat (limited to 'src/cmd/acme/text.c')
-rw-r--r--src/cmd/acme/text.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/cmd/acme/text.c b/src/cmd/acme/text.c
index 8aac0ac0..5f087f5d 100644
--- a/src/cmd/acme/text.c
+++ b/src/cmd/acme/text.c
@@ -45,7 +45,7 @@ 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; /* back fill to scroll bar */
+ rr.min.x -= Scrollwid+Scrollgap; /* back fill to scroll bar */
draw(t->fr.b, rr, t->fr.cols[BACK], nil, ZP);
/* use no wider than 3-space tabs in a directory */
maxt = maxtab;
@@ -193,6 +193,10 @@ textload(Text *t, uint q0, char *file, int setqid)
if(t->ncache!=0 || t->file->b.nc || t->w==nil || t!=&t->w->body || (t->w->isdir && t->file->nname==0))
error("text.load");
+ if(t->w->isdir && t->file.nname==0){
+ warning(nil, "empty directory name");
+ return 0;
+ }
fd = open(file, OREAD);
if(fd < 0){
warning(nil, "can't open %s: %r\n", file);
@@ -645,7 +649,10 @@ texttype(Text *t, Rune r)
switch(r){
case Kleft:
if(t->q0 > 0){
- wincommit(t->w, t);
+ if(t->w)
+ wincommit(t->w, t);
+ else
+ textcommit(t->w, TRUE);
textshow(t, t->q0-1, t->q0-1, TRUE);
}
return;