Selection range and ctrl* fixes
This commit is contained in:
parent
403363ae69
commit
bdac1ac43f
1 changed files with 15 additions and 1 deletions
16
blash.js
16
blash.js
|
@ -214,9 +214,12 @@ function blash ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
} else if ( key == 76 && evt.ctrlKey ) {
|
} else if ( key == 76 && evt.ctrlKey ) {
|
||||||
// CTRL-l clears the screen
|
// CTRL-l clears the screen
|
||||||
this.refreshPrompt ( true );
|
this.refreshPrompt ( true );
|
||||||
|
return false;
|
||||||
} else if ( key == 13 || key == 10 || ( key == 67 && evt.ctrlKey )) {
|
} else if ( key == 13 || key == 10 || ( key == 67 && evt.ctrlKey )) {
|
||||||
if ( this.prompt.value.length != 0 && ( key != 67 || !evt.ctrlKey ))
|
if ( this.prompt.value.length != 0 && ( key != 67 || !evt.ctrlKey ))
|
||||||
{
|
{
|
||||||
|
@ -296,7 +299,12 @@ function blash ()
|
||||||
this.prompt.focus();
|
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 ( key == 38 )
|
||||||
{
|
{
|
||||||
if ( this.history_index < 0 )
|
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();
|
this.prompt.focus();
|
||||||
} else if ( key == 9 ) {
|
} else if ( key == 9 ) {
|
||||||
this.prompt.focus();
|
this.prompt.focus();
|
||||||
|
|
Loading…
Reference in a new issue