Skip to content

Commit 2a8cc4c

Browse files
committed
fix: restore old behavior of not preventing default and not executing keybindings with empty command ID bound (microsoft#181920)
* abstractKeybindingService: fix: don't try executing keybindings with empty command IDs * abstractKeybindingService: fix: restore old behavior that wouldn't prevent default if the keybinding has an empty command ID (unless the keybinding consists of more than one chord)
1 parent 252e546 commit 2a8cc4c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/vs/platform/keybinding/common/abstractKeybindingService.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,17 +342,16 @@ export abstract class AbstractKeybindingService extends Disposable implements IK
342342

343343
this._logService.trace('KeybindingService#dispatch', keypressLabel, `[ Will dispatch command ${resolveResult.commandId} ]`);
344344

345-
if (resolveResult.commandId === null) {
345+
if (resolveResult.commandId === null || resolveResult.commandId === '') {
346346

347347
if (this.inChordMode) {
348348
const currentChordsLabel = this._currentChords.map(({ label }) => label).join(', ');
349349
this._log(`+ Leaving chord mode: Nothing bound to "${currentChordsLabel}, ${keypressLabel}".`);
350350
this._notificationService.status(nls.localize('missing.chord', "The key combination ({0}, {1}) is not a command.", currentChordsLabel, keypressLabel), { hideAfter: 10 * 1000 /* 10s */ });
351351
this._leaveChordMode();
352+
shouldPreventDefault = true;
352353
}
353354

354-
shouldPreventDefault = true;
355-
356355
} else {
357356
if (this.inChordMode) {
358357
this._leaveChordMode();

0 commit comments

Comments
 (0)