Skip to content

Commit

Permalink
Optimize keydown/up events by only working on !repeat
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Sep 5, 2020
1 parent 206d764 commit 5faa26d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ export class TerminalLink extends DisposableStore implements ILink {
// Listen for modifier before handing it off to the hover to handle so it gets disposed correctly
this._hoverListeners = new DisposableStore();
this._hoverListeners.add(dom.addDisposableListener(document, 'keydown', e => {
if (this._isModifierDown(e)) {
if (!e.repeat && this._isModifierDown(e)) {
this._enableDecorations();
}
}));
this._hoverListeners.add(dom.addDisposableListener(document, 'keyup', e => {
if (!this._isModifierDown(e)) {
if (!e.repeat && !this._isModifierDown(e)) {
this._disableDecorations();
}
}));
Expand Down

0 comments on commit 5faa26d

Please sign in to comment.