Evaluate the custom keydown event handler before scrolling down
Fixes #368
This commit is contained in:
+4
-4
@@ -2425,15 +2425,15 @@ Terminal.prototype.attachCustomKeydownHandler = function(customKeydownHandler) {
|
|||||||
* @param {KeyboardEvent} ev The keydown event to be handled.
|
* @param {KeyboardEvent} ev The keydown event to be handled.
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.keyDown = function(ev) {
|
Terminal.prototype.keyDown = function(ev) {
|
||||||
|
if (this.customKeydownHandler && this.customKeydownHandler(ev) === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Scroll down to prompt, whenever the user presses a key.
|
// Scroll down to prompt, whenever the user presses a key.
|
||||||
if (this.ybase !== this.ydisp) {
|
if (this.ybase !== this.ydisp) {
|
||||||
this.scrollToBottom();
|
this.scrollToBottom();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.customKeydownHandler && this.customKeydownHandler(ev) === false) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.compositionHelper.keydown.bind(this.compositionHelper)(ev)) {
|
if (!this.compositionHelper.keydown.bind(this.compositionHelper)(ev)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user