Skip to content
Snippets Groups Projects
Commit f56e58d9 authored by rswindell's avatar rswindell
Browse files

More intelligent tab calculation.

Fixed length calculation (off by one).
parent 03232c07
No related branches found
No related tags found
No related merge requests found
......@@ -469,15 +469,19 @@ js_word_wrap(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
l=0;
col=1;
}
else if(inbuf[i]=='\t')
col+=8;
else if(inbuf[i]>=' ')
else if(inbuf[i]=='\t') {
if((col%8)==0)
col++;
while(col%8)
col++;
} else if(inbuf[i]>=' ')
col++;
linebuf[l]=inbuf[i++];
if(col<len && l<len) {
if(col<=len && l<=len) {
l++;
continue;
}
/* wrap line here */
k=l;
while(k && linebuf[k]>' ') k--;
if(k==0) /* continuous printing chars, no word wrap possible */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment