cmd+A work again (#1102)

This commit is contained in:
Philippe Potvin 2016-12-08 18:09:02 -05:00 committed by Matheus Fernandes
parent 59a3583028
commit a45fb97283

View file

@ -15,9 +15,13 @@ const containers = [];
// Provide selectAll to terminal viewport
hterm.Terminal.prototype.selectAll = function () {
// We need to clear the DOM range to reset anchorNode
selection.clear(this);
selection.all(this);
// If the cursorNode_ having hyperCaret we need to remove it
if (this.cursorNode_.contains(this.hyperCaret)) {
this.cursorNode_.removeChild(this.hyperCaret);
// We need to clear the DOM range to reset anchorNode
selection.clear(this);
selection.all(this);
}
};
const oldSetFontSize = hterm.Terminal.prototype.setFontSize;
@ -218,6 +222,10 @@ hterm.Terminal.prototype.copySelectionToClipboard = function () {
// hyper and not the terminal itself
const oldKeyDown = hterm.Keyboard.prototype.onKeyDown_;
hterm.Keyboard.prototype.onKeyDown_ = function (e) {
// Was the hyperCaret removed for selectAll
if (!this.terminal.cursorNode_.contains(this.hyperCaret)) {
this.terminal.focusHyperCaret();
}
const modifierKeysConf = this.terminal.modifierKeys;
if (e.altKey &&