Skip to content

Commit

Permalink
Keep the limit at 2 chords in the widget for now
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Mar 16, 2023
1 parent 5303e9d commit 55c32ae
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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")));
Expand Down

0 comments on commit 55c32ae

Please sign in to comment.