summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorppatience0 <ppatience0@gmail.com>2013-05-08 20:34:50 -0400
committerppatience0 <ppatience0@gmail.com>2013-05-08 20:34:50 -0400
commitc24a442ae2e86da88df506cf8cafcf59eaf2f770 (patch)
tree5151657c5871fe6c1d7ba783726b2267ea991c5c /sys
parent6a2b5055f5c2827d66c18f2c6e5aed284956f980 (diff)
samterm: revert previous changes.
Diffstat (limited to 'sys')
-rw-r--r--sys/src/cmd/samterm/main.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/sys/src/cmd/samterm/main.c b/sys/src/cmd/samterm/main.c
index c20091acb..6ee72c94a 100644
--- a/sys/src/cmd/samterm/main.c
+++ b/sys/src/cmd/samterm/main.c
@@ -359,29 +359,19 @@ getcol(Rasp *r, long p)
return col;
}
-int
-sptotab(Rasp *r, long p)
-{
- int i, col, n;
-
- col = getcol(r, p);
- if((n = maxtab - col % maxtab) == maxtab)
- n = 0;
- for(i = 0; p < r->nrunes && raspc(r, p)==' ' && i<n; p++, i++)
- ;
- return i;
-}
-
long
del(Rasp *r, long o, long p)
{
- int i;
+ int i, col, n;
if(--p < o)
return o;
if(!spacesindent || raspc(r, p)!=' ')
return p;
- for(i = 0; p-1>=o && raspc(r, p-1)==' ' && i<maxtab-1; --p, i++)
+ col = getcol(r, p) + 1;
+ if((n = col % maxtab) == 0)
+ n = maxtab;
+ for(i = 0; p-1>=o && raspc(r, p-1)==' ' && i<n-1; --p, i++)
;
return p>=o? p : o;
}
@@ -632,8 +622,6 @@ type(Flayer *l, int res) /* what a bloody mess this is */
switch(c){
case '\b':
case 0x7F: /* del */
- if(spacesindent)
- a += sptotab(&t->rasp, a);
l->p0 = del(&t->rasp, l->origin, a);
break;
case 0x15: /* ctrl-u */