Optimize keydown/up events by only working on !repeat

This commit is contained in:
Daniel Imms 2020-09-04 22:54:46 -07:00
parent 206d764c6d
commit 5faa26d933

View file

@ -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();
}
}));