add: spos++; 
context: function make_lines(str, attr, nl_is_hardcr){	nl=new Array();	var spos=0;	var apos=0;	thisattr=7;	while(spos < str.length) {		var done=false;		nl[nl.length]=new Line;		while(spos < str.length && !done) {			if(apos < attr.length) {				thisattr=ascii(attr.charAt(apos));				apos++;			}			switch(str.charAt(spos)) {				case '\r':					spos++;					break;				case '\x01':					spos++;					switch(str.charAt(spos).toUpperCase()) {						case 'K':							thisattr&=0xf8;							break;						case 'R':							thisattr=(thisattr&0xf8)|RED;							break;						case 'G':							thisattr=(thisattr&0xf8)|GREEN;							break;						case 'Y':							thisattr=(thisattr&0xf8)|BROWN;							break;						case 'B':							thisattr=(thisattr&0xf8)|BLUE;							break;						case 'M':							thisattr=(thisattr&0xf8)|MAGENTA;							break;						case 'C':							thisattr=(thisattr&0xf8)|CYAN;							break;						case 'W':							thisattr=(thisattr&0xf8)|LIGHTGRAY;							break;						case '0':							thisattr=(thisattr&0x8f);							break;						case '1':							thisattr=(thisattr&0x8f)|(RED<<4);							break;						case '2':							thisattr=(thisattr&0x8f)|(GREEN<<4);							break;						case '3':							thisattr=(thisattr&0x8f)|(BROWN<<4);							break;						case '4':							thisattr=(thisattr&0x8f)|(BLUE<<4);							break;						case '5':							thisattr=(thisattr&0x8f)|(MAGENTA<<4);							break;						case '6':							thisattr=(thisattr&0x8f)|(CYAN<<4);							break;						case '7':							thisattr=(thisattr&0x8f)|(LIGHTGRAY<<4);							break;						case 'H':							thisattr|=0x08;							break;						case 'I':							thisattr|=0x80;							break;						case 'N':							thisattr=7;							break;						case '\x01':							/* ToDo: This needs to fall through to the wrapping stuff. */							nl[nl.length-1].text+=str.charAt(spos);							nl[nl.length-1].attr+=ascii(thisattr);							break;					}					spos++;					break;				case '\n':					spos++;					done=true;					if(nl_is_hardcr)						nl[nl.length-1].hardcr=true;					else {						/* Deduce if this is a hard or soft CR as follows */						/* If the next char is a nl, or whitespace, it is hard. */						/* If there is room for the first word of the next line on this						 * line, it is hard */						/* Otherwise, it is soft. */						if(str.charAt(spos)==' ' || str.charAt(spos)=='\t')							nl[nl.length-1].hardcr=true;						else {							var len;							for(len=0; str.length>=len+spos && str.charAt(spos+len)!=' ' && str.charAt(spos+len,1)!='\t'; len++);							if(nl[nl.length-1].text.length+len < 80)								nl[nl.length-1].hardcr=true;						}					}					break;				case ' ':		/* Whitespace... never wrap here. */					nl[nl.length-1].text+=str.charAt(spos);					nl[nl.length-1].attr+=ascii(thisattr);					spos++;					break;				case '\t':		/* Whitespace... never wrap here. */					nl[nl.length-1].text+=' ';					nl[nl.length-1].attr+=ascii(thisattr);					while(nl[nl.length-1].text.length%8) {						nl[nl.length-1].text+=' ';						nl[nl.length-1].attr+=ascii(thisattr);					}					break;				default:		/* Printable char... may need to wrap */					if(nl[nl.length-1].text.length>79) {	/* Need to have wrapped */						var offset;						for(offset=nl[nl.length-1].text.length-1; offset>=0; offset--) {							if(nl[nl.length-1].text.charAt(offset)!=' ' && nl[nl.length-1].text.charAt(offset)!='\t') {								/* ToDo: Verify/test this... it's probobly wrong */								spos-=nl[nl.length-1].text.length-1-offset;								spos--;								break;							}						}						if(offset==-1) {							/* There were no spaces this line. */							nl[nl.length-1].kludged=true;							spos--;						}						done=true;					}					else {						nl[nl.length-1].text+=str.charAt(spos);						nl[nl.length-1].attr+=ascii(thisattr);						spos++;					}			}		}	}	return(nl);}
meta: 9592	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9592/3681f6c76a3a048953a0b7d8ab886067a6ba246b/fseditor.js/clean/fseditor.js