Evaluate the custom keydown event handler before scrolling down

Fixes #368
This commit is contained in:
Daniel Imms
2016-11-21 14:04:13 -08:00
parent 64f6610f11
commit c15fed382d
+4 -4
View File
@@ -2425,15 +2425,15 @@ Terminal.prototype.attachCustomKeydownHandler = function(customKeydownHandler) {
* @param {KeyboardEvent} ev The keydown event to be handled.
*/
Terminal.prototype.keyDown = function(ev) {
if (this.customKeydownHandler && this.customKeydownHandler(ev) === false) {
return false;
}
// Scroll down to prompt, whenever the user presses a key.
if (this.ybase !== this.ydisp) {
this.scrollToBottom();
}
if (this.customKeydownHandler && this.customKeydownHandler(ev) === false) {
return false;
}
if (!this.compositionHelper.keydown.bind(this.compositionHelper)(ev)) {
return false;
}