rem: for(;l>line.length;l++) 
add: for(;l<line.length;l++) 
context: function unwrap_line(l){	var done=false;	var words;	var space;	var re;	var lines=0;	var ret=-1;	var first=true;	var old_lines=line.length;	while(!done && line[l+1]!=undefined) {		if(line[l]==undefined) {			draw_line(l);			l++;			break;		}		/* There's a hardcr... all done now. */		if(line[l].hardcr)			break;		space=79-line[l].text.length;		if(space<1)			break;		/* Attempt to unkludge... */		if(line[l].kludged) {			re=new RegExp("^([^\\s]{1,"+space+"}\\s*)","");			words=line[l+1].text.match(re);			if(words != null) {				line[l].text+=words[1];				line[l].attr+=line[l+1].attr.substr(0,words[1].length);				line[l+1].text=line[l+1].text.substr(words[1].length);				line[l+1].attr=line[l+1].attr.substr(words[1].length);				space-=words[1].length;				if(first)					ret=words[1].length;				if(line[l+1].text.length==0) {					line[l].kludged=false;					line[l].hardcr=line[l+1].hardcr;					line.splice(l+1,1);				}				if(words[1].search(/\s/)!=-1)					line[l].kludged=false;				lines++;			}			else				line[l].kludged=false;		}		/* Get first word(s) of next line */		re=new RegExp("^(.{1,"+space+"}(?![^\\s])\\s*)","");		words=line[l+1].text.match(re);		if(words != null) {			line[l].text+=words[1];			line[l].attr+=line[l+1].attr.substr(0,words[1].length);			line[l+1].text=line[l+1].text.substr(words[1].length);			line[l+1].attr=line[l+1].attr.substr(words[1].length);			if(first) {				if(ret==-1)					ret=words[1].length;				else					ret+=words[1].length;			}			if(line[l+1].text.length==0) {				line[l].hardcr=line[l+1].hardcr;				line.splice(l+1,1);			}			lines++;		}		else {			/* Nothing on the next line... can't be kludged */			if(line[l].kludged)				line[l].kludged=false;			if(line[l+1].text.length==0) {				line[l].hardcr=line[l+1].hardcr;				line.splice(l+1,1);				/* 				 * We deleted a line... now we need to redraw that line				 *  and everything after it.				 */				var i;				for(i=l+1;i<topline+lines_on_screen;i++)					draw_line(i);			}			done=true;		}		if(lines>0)			draw_line(l);		l++;		first=false;	}	if(lines>0) {		draw_line(l++);	}	if(old_lines!=line.length) {		/* We need to redraw everything... line(s) deleted */		for(;l>line.length;l++)			draw_line(l);	}	return(ret);}
meta: 9592	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9592/ee634d5a4b7f732ffaf47795089cfdd1d0270a54/fseditor.js/buggy/fseditor.js