提交 beabc815 编写于 作者: A Alex Dima

Fixes #69146

上级 df7545e6
...@@ -967,6 +967,13 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper { ...@@ -967,6 +967,13 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper {
for (let part of keybinding.parts) { for (let part of keybinding.parts) {
chordParts.push(this.simpleKeybindingToScanCodeBinding(part)); chordParts.push(this.simpleKeybindingToScanCodeBinding(part));
} }
return this._toResolvedKeybinding(chordParts);
}
private _toResolvedKeybinding(chordParts: ScanCodeBinding[][]): NativeResolvedKeybinding[] {
if (chordParts.length === 0) {
return [];
}
let result: NativeResolvedKeybinding[] = []; let result: NativeResolvedKeybinding[] = [];
this._generateResolvedKeybindings(chordParts, 0, [], result); this._generateResolvedKeybindings(chordParts, 0, [], result);
return result; return result;
...@@ -1055,9 +1062,7 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper { ...@@ -1055,9 +1062,7 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper {
public resolveUserBinding(input: (SimpleKeybinding | ScanCodeBinding)[]): ResolvedKeybinding[] { public resolveUserBinding(input: (SimpleKeybinding | ScanCodeBinding)[]): ResolvedKeybinding[] {
const parts: ScanCodeBinding[][] = input.map(keybinding => this._resolveSimpleUserBinding(keybinding)); const parts: ScanCodeBinding[][] = input.map(keybinding => this._resolveSimpleUserBinding(keybinding));
let result: NativeResolvedKeybinding[] = []; return this._toResolvedKeybinding(parts);
this._generateResolvedKeybindings(parts, 0, [], result);
return result;
} }
private static _charCodeToKb(charCode: number): { keyCode: KeyCode; shiftKey: boolean } | null { private static _charCodeToKb(charCode: number): { keyCode: KeyCode; shiftKey: boolean } | null {
......
...@@ -70,6 +70,10 @@ suite('keyboardMapper - MAC fallback', () => { ...@@ -70,6 +70,10 @@ suite('keyboardMapper - MAC fallback', () => {
); );
}); });
test('resolveUserBinding empty', () => {
assertResolveUserBinding(mapper, [], []);
});
test('resolveUserBinding Cmd+[Comma] Cmd+/', () => { test('resolveUserBinding Cmd+[Comma] Cmd+/', () => {
assertResolveUserBinding( assertResolveUserBinding(
mapper, [ mapper, [
......
...@@ -304,6 +304,10 @@ suite('keyboardMapper - MAC de_ch', () => { ...@@ -304,6 +304,10 @@ suite('keyboardMapper - MAC de_ch', () => {
); );
}); });
test('resolveUserBinding empty', () => {
assertResolveUserBinding(mapper, [], []);
});
test('resolveUserBinding Cmd+[Comma] Cmd+/', () => { test('resolveUserBinding Cmd+[Comma] Cmd+/', () => {
assertResolveUserBinding( assertResolveUserBinding(
mapper, mapper,
......
...@@ -270,6 +270,10 @@ suite('keyboardMapper - WINDOWS de_ch', () => { ...@@ -270,6 +270,10 @@ suite('keyboardMapper - WINDOWS de_ch', () => {
); );
}); });
test('resolveUserBinding empty', () => {
assertResolveUserBinding(mapper, [], []);
});
test('resolveUserBinding Ctrl+[Comma] Ctrl+/', () => { test('resolveUserBinding Ctrl+[Comma] Ctrl+/', () => {
assertResolveUserBinding( assertResolveUserBinding(
mapper, [ mapper, [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册