editor: fix enter key keep line in view

pull/4639/head
John McLear 2021-01-08 14:22:26 +00:00
parent 04962bfe39
commit b26548011c
1 changed files with 4 additions and 0 deletions

View File

@ -2792,6 +2792,10 @@ function Ace2Inner() {
if (keyCode == 13 && browser.opera && (type == 'keypress')) {
return; // This stops double enters in Opera but double Tabs still show on single tab keypress, adding keyCode == 9 to this doesn't help as the event is fired twice
}
// Ensure caret is always on focus on enter key
if (keyCode === 13 && (type === 'keypress')) {
fixView();
}
let specialHandled = false;
const isTypeForSpecialKey = ((browser.safari || browser.chrome || browser.firefox) ? (type == 'keydown') : (type == 'keypress'));
const isTypeForCmdKey = ((browser.safari || browser.chrome || browser.firefox) ? (type == 'keydown') : (type == 'keypress'));