rem: l++; 
add: m=line[l].text.match(/^(.{1,79}\s+)([^\s].*?)$/); if(m==null) { /* * We couldn't apparently find a space after a char... this means * we need to kludge wrap this (ick) */ m=line[l].text.match(/^(.{1,79})(.*?)$/); line[l].kludged=true; } if(m!=null) { if(line[l+1]==undefined) line.push(new Line); line[l+1].text=m[2]+line[l+1].text; line[l+1].attr=line[l].attr.substr(m[1].length)+line[l+1].attr; line[l].text=m[1]; line[l].attr=line[l].attr.substr(0,line[l].text.length); draw_line(l); if(ret==-1) ret=m[2].length; l++; } else { /* This can't happen */ alert("The impossible happened."); console.pause(); exit(); } 
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: 9592	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9592/d3dfc7c910d9487d1b5e959a6c82f51a1ba0c617/fseditor.js/clean/fseditor.js