rem: while(line[l].text.length>79) { if(line[l+1]==undefined || line[l].hardcr) add_new_line_below(l); nline=line[l].text.replace(/^(.*)\s+(.*?)$/,function (str, start, end, pos, s) { line[l+1].text=end+" "+line[l+1].text; /* Copy attributes */ line[l+1].attr.splice(0,0,line[l+1].attr.slice(line[l].text.length-end.length,end.length).toSource()); /* Add an attribute for the space */ line[l+1].attr.splice(end.length+1,0,curattr); /* Trim whitespace from end */ line[l+1].text=line[l+1].text.replace(/\s+$/,''); /* Move the hardcr */ line[l+1].hardcr=line[l].hardcr; line[l].hardcr=false; if(!ret) ret=end.length+1; return(start); }); if(nline != line[l].text) { line[l].text=nline; redraw_line(l); 
add: while(1) { /* Get line length without trailing whitespace */ m=line[l].text.match(/^(.*?)\s*$/); if(m!=null) { if(m[1].length<80 && (m[1].length!=line[l].text.length || line[l+1]==undefined || line[l].hardcr==true)) { if(ret!=-1) draw_line(l); return(ret); } 
context: function wrap_line(l){	var ret=0;	var nline;	while(line[l].text.length>79) {		if(line[l+1]==undefined || line[l].hardcr)			add_new_line_below(l);		nline=line[l].text.replace(/^(.*)\s+(.*?)$/,function (str, start, end, pos, s) {			line[l+1].text=end+" "+line[l+1].text;			/* Copy attributes */			line[l+1].attr.splice(0,0,line[l+1].attr.slice(line[l].text.length-end.length,end.length).toSource());			/* Add an attribute for the space */			line[l+1].attr.splice(end.length+1,0,curattr);			/* Trim whitespace from end */			line[l+1].text=line[l+1].text.replace(/\s+$/,'');			/* Move the hardcr */			line[l+1].hardcr=line[l].hardcr;			line[l].hardcr=false;			if(!ret)				ret=end.length+1;			return(start);		});		if(nline != line[l].text) {			line[l].text=nline;			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