mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Keep the limit at 2 chords in the widget for now
This commit is contained in:
parent
5303e9d7e1
commit
55c32ae2e0
|
@ -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")));
|
||||
|
|
Loading…
Reference in a new issue