Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix text deselect #1218

Merged
merged 1 commit into from
Dec 15, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions lib/hterm.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,20 +213,22 @@ hterm.Keyboard.prototype.onKeyDown_ = function (e) {

if (e.altKey || e.metaKey || isAccelerator(e)) {
// hterm shouldn't consume a hyper accelerator
// // Was the hyperCaret removed for selectAll
if (e.key === 'v' && !this.terminal.cursorNode_.contains(this.hyperCaret)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ppot why this is here? 🤔

this.terminal.focusHyperCaret();
}
return;
}

// Test for valid keys in order to accept clear status
if (e.code !== 'Control' && e.key !== 'Shift' && e.code !== 'CapsLock' && e.key !== 'Dead') {
selection.clear(this.terminal);
}

// Was the hyperCaret removed for selectAll
if (!this.terminal.cursorNode_.contains(this.hyperCaret)) {
this.terminal.focusHyperCaret();
}

if ((!e.ctrlKey || e.code !== 'ControlLeft') &&
!e.shiftKey && e.code !== 'CapsLock' &&
e.key !== 'Dead') {
// Test for valid keys in order to clear the terminal selection
selection.clear(this.terminal);
}
return oldKeyDown.call(this, e);
};

Expand Down