Selection range and ctrl* fixes

This commit is contained in:
BlackLight 2010-12-26 18:18:21 +01:00
parent 403363ae69
commit bdac1ac43f
1 changed files with 15 additions and 1 deletions

View File

@ -214,9 +214,12 @@ function blash ()
}
}
}
return false;
} else if ( key == 76 && evt.ctrlKey ) {
// CTRL-l clears the screen
this.refreshPrompt ( true );
return false;
} else if ( key == 13 || key == 10 || ( key == 67 && evt.ctrlKey )) {
if ( this.prompt.value.length != 0 && ( key != 67 || !evt.ctrlKey ))
{
@ -296,7 +299,12 @@ function blash ()
this.prompt.focus();
}
}
} else if ( key == 38 || key == 40 ) {
if ( key == 67 && evt.ctrlKey )
{
return false;
}
} else if (( key == 38 || key == 40 ) && this.history.length > 0 ) {
if ( key == 38 )
{
if ( this.history_index < 0 )
@ -321,6 +329,12 @@ function blash ()
}
}
// Put the cursor at the end
if ( this.prompt.setSelectionRange )
{
this.prompt.setSelectionRange ( this.prompt.value.length, this.prompt.value.length );
}
this.prompt.focus();
} else if ( key == 9 ) {
this.prompt.focus();