mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-11 10:38:31 -05:00
Merge from vscode e558dc6ea73a75bd69d7a0b485f0e7e4194c66bf (#6864)
This commit is contained in:
@@ -176,6 +176,7 @@ export class BrowserKeyboardMapperFactoryBase {
|
||||
}
|
||||
|
||||
setActiveKeyMapping(keymap: IKeyboardMapping | null) {
|
||||
let keymapUpdated = false;
|
||||
let matchedKeyboardLayout = this.getMatchedKeymapInfo(keymap);
|
||||
if (matchedKeyboardLayout) {
|
||||
// let score = matchedKeyboardLayout.score;
|
||||
@@ -209,18 +210,21 @@ export class BrowserKeyboardMapperFactoryBase {
|
||||
|
||||
if (!this._activeKeymapInfo) {
|
||||
this._activeKeymapInfo = matchedKeyboardLayout.result;
|
||||
keymapUpdated = true;
|
||||
} else if (keymap) {
|
||||
if (matchedKeyboardLayout.result.getScore(keymap) > this._activeKeymapInfo.getScore(keymap)) {
|
||||
this._activeKeymapInfo = matchedKeyboardLayout.result;
|
||||
keymapUpdated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!this._activeKeymapInfo) {
|
||||
this._activeKeymapInfo = this.getUSStandardLayout();
|
||||
keymapUpdated = true;
|
||||
}
|
||||
|
||||
if (!this._activeKeymapInfo) {
|
||||
if (!this._activeKeymapInfo || !keymapUpdated) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,12 +40,12 @@ suite('keyboard layout loader', () => {
|
||||
let commandService = instantiationService.stub(ICommandService, {});
|
||||
let instance = new TestKeyboardMapperFactory(notitifcationService, storageService, commandService);
|
||||
|
||||
test.skip('load default US keyboard layout', () => {
|
||||
test('load default US keyboard layout', () => {
|
||||
assert.notEqual(instance.activeKeyboardLayout, null);
|
||||
assert.equal(instance.activeKeyboardLayout!.isUSStandard, true);
|
||||
});
|
||||
|
||||
test.skip('isKeyMappingActive', () => {
|
||||
test('isKeyMappingActive', () => {
|
||||
instance.setUSKeyboardLayout();
|
||||
assert.equal(instance.isKeyMappingActive({
|
||||
KeyA: {
|
||||
value: 'a',
|
||||
|
||||
Reference in New Issue
Block a user