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

Fixes #69146

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