rem: console.gotoxy(1,ypos); 
context: function edit(){	var key;	console.gotoxy(xpos,ypos);	while(1) {		key=console.inkey(1000);		if(key=='')			continue;		switch(key) {			/* We're getting all the CTRL keys here... */			case '\x00':			case '\x01':				break;			case '\x02':	/* KEY_HOME */				xpos=1;				console.gotoxy(xpos,ypos);				break;			case '\x03':			case '\x04':				break;			case '\x05':	/* KEY_END */				xpos=line[ypos-edit_top+topline].text.length+1;				if(xpos>80)					xpos=80;				console.gotoxy(xpos,ypos);				break;			case '\x06':	/* KEY_RIGHT */				xpos++;				if(xpos>line[ypos-edit_top+topline].text.length+1) {					xpos--;					console.beep();				}				if(xpos>80) {					xpos=1;					try_next_line();				}				console.gotoxy(xpos,ypos);				break;			case '\x07':				break;			case '\x08':	/* Backspace */				/* ToDo: Backspace onto the previous row and re-wrap... */				if(xpos==0) {				}			case '\x09':	/* TAB... ToDo expand to spaces */				break;			case '\x0a':	/* KEY_DOWN */				try_next_line();				console.gotoxy(xpos,ypos);				break;			case '\x0b':			case '\x0c':			case '\x0d':	/* CR */				/* ToDo: Break current line at current pos... */				if(insert)					add_new_line_below();				next_line();				xpos=1;				console.gotoxy(xpos,ypos);				break;			case '\x0e':			case '\x0f':			case '\x10':			case '\x11':	/* CTRL-Q */				return;			case '\x12':			case '\x13':			case '\x14':			case '\x15':			case '\x16':			case '\x17':			case '\x18':			case '\x19':			case '\x1a':			case '\x1b':			case '\x1c':				break;			case '\x1d':	/* KEY_LEFT */				xpos--;				if(xpos<=0) {					console.beep();					xpos=1;				}				console.gotoxy(xpos,ypos);				break;			case '\x1e':	/* KEY_UP */				try_prev_line();				console.gotoxy(xpos,ypos);				break;			case '\x1f':				break;			case '\xf7':	/* DELETE */				break;			default:		/* Insert the char */				if(insert) {					line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1)							+key							+line[ypos-edit_top+topline].text.substr(xpos-1);					line[ypos-edit_top+topline].attr.splice(ypos,0,curattr);					if(line[ypos-edit_top+topline].text.length > 80) {						/* ToDo: Wrap */					}				}				else {					line[ypos-edit_top+topline].text=line[ypos-edit_top+topline].text.substr(0,xpos-1)							+key							+line[ypos-edit_top+topline].text.substr(xpos);				}				console.gotoxy(1,ypos);				line[ypos-edit_top+topline].draw(ypos);				console.gotoxy(xpos,ypos);				xpos++;				if(xpos>80) {					xpos=1;					if(insert)						add_new_line_below();					next_line();					break;				}				console.gotoxy(xpos,ypos);		}	}}
meta: 9592	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9592/080501686e49907e8931bee613def09ea5a762fa/fseditor.js/clean/fseditor.js