rem: line[l].text+=" "+words[1]; line[l].attr[line[l].attr.length]=curattr; line[l].attr.splice(line[l].text.length,0,line[l+1].attr.slice(0,words[1].length)); line[l+1].text=line[l+1].text.substr(words[0].length+1); line[l+1].attr.splice(0,words[0].length+1); /* Trim spaces from the start of the line now. */ words=line[l+1].text.match(/^\s+/); if(words!=null) { line[l+1].text=line[l+1].text.substr(words[0].length); line[l+1].attr.splice(0,words[0].length); 
add: 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; 
context: function unwrap_line(l){	var ret=0;	var nline;	var done=false;	var words;	var space;	var re;	while(!done && line[l+1]!=undefined) {		/* There's a hardcr... all done now. */		if(line[l].hardcr)			break;		words='';		/* Trim whitespace from end */		line[l].text=line[l].text.replace(/\s+$/,'');		space=79-line[l].text.length-1;		if(space<1)			break;		/* Get first word(s) of next line */		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].attr.length]=curattr;			line[l].attr.splice(line[l].text.length,0,line[l+1].attr.slice(0,words[1].length));			line[l+1].text=line[l+1].text.substr(words[0].length+1);			line[l+1].attr.splice(0,words[0].length+1);			/* Trim spaces from the start of the line now. */			words=line[l+1].text.match(/^\s+/);			if(words!=null) {				line[l+1].text=line[l+1].text.substr(words[0].length);				line[l+1].attr.splice(0,words[0].length);			}		}		else			done=true;		redraw_line(l);		l++;	}	redraw_line(l);	return(ret);}
meta: 4284	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4284/01df868790e712324b0ea222651723cca8476031/fseditor.js/buggy/fseditor.js