From 55c32ae2e000df39fd631a32972f6c8a5d076103 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Thu, 16 Mar 2023 14:33:02 +0100 Subject: [PATCH] Keep the limit at 2 chords in the widget for now --- .../contrib/preferences/browser/keybindingWidgets.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/preferences/browser/keybindingWidgets.ts b/src/vs/workbench/contrib/preferences/browser/keybindingWidgets.ts index a3485fda069ba..3fe86c30e2b20 100644 --- a/src/vs/workbench/contrib/preferences/browser/keybindingWidgets.ts +++ b/src/vs/workbench/contrib/preferences/browser/keybindingWidgets.ts @@ -117,6 +117,10 @@ export class KeybindingsSearchWidget extends SearchWidget { if (!this._chords) { this._chords = []; } + if (this._chords.length === 2) { + // TODO: keep the limit at 2 for now + this._chords = []; + } const lastChordIsComplete = (this._chords.length === 0 || this._chords[this._chords.length - 1].getDispatchChords()[0] !== null); if (lastChordIsComplete) { this._chords.push(keybinding); @@ -242,12 +246,9 @@ export class DefineKeybindingWidget extends Widget { dom.clearNode(this._outputNode); dom.clearNode(this._showExistingKeybindingsNode); - - const firstLabel = new KeybindingLabel(this._outputNode, OS, defaultKeybindingLabelStyles); firstLabel.set(withNullAsUndefined(this._chords?.[0])); - if (this._chords) { for (let i = 1; i < this._chords.length; i++) { this._outputNode.appendChild(document.createTextNode(nls.localize('defineKeybinding.chordsTo', "chord to")));