mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-01 17:23:35 -05:00
Merge from vscode dbe62be3266ffb6772a7f3db0bf61d63f4aa7f65 (#9337)
This commit is contained in:
@@ -35,6 +35,10 @@ export abstract class AbstractKeybindingService extends Disposable implements IK
|
||||
private _currentChordChecker: IntervalTimer;
|
||||
private _currentChordStatusMessage: IDisposable | null;
|
||||
|
||||
public get inChordMode(): boolean {
|
||||
return !!this._currentChord;
|
||||
}
|
||||
|
||||
constructor(
|
||||
private _contextKeyService: IContextKeyService,
|
||||
protected _commandService: ICommandService,
|
||||
|
||||
@@ -50,6 +50,8 @@ export const IKeybindingService = createDecorator<IKeybindingService>('keybindin
|
||||
export interface IKeybindingService {
|
||||
_serviceBrand: undefined;
|
||||
|
||||
readonly inChordMode: boolean;
|
||||
|
||||
onDidUpdateKeybindings: Event<IKeybindingEvent>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,7 +11,10 @@ import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKe
|
||||
import { keys } from 'vs/base/common/map';
|
||||
|
||||
export interface IResolveResult {
|
||||
/** Whether the resolved keybinding is entering a chord */
|
||||
enterChord: boolean;
|
||||
/** Whether the resolved keybinding is leaving (and executing) a chord */
|
||||
leaveChord: boolean;
|
||||
commandId: string | null;
|
||||
commandArgs: any;
|
||||
bubble: boolean;
|
||||
@@ -285,6 +288,7 @@ export class KeybindingResolver {
|
||||
if (currentChord === null && result.keypressParts.length > 1 && result.keypressParts[1] !== null) {
|
||||
return {
|
||||
enterChord: true,
|
||||
leaveChord: false,
|
||||
commandId: null,
|
||||
commandArgs: null,
|
||||
bubble: false
|
||||
@@ -293,6 +297,7 @@ export class KeybindingResolver {
|
||||
|
||||
return {
|
||||
enterChord: false,
|
||||
leaveChord: result.keypressParts.length > 1,
|
||||
commandId: result.command,
|
||||
commandArgs: result.commandArgs,
|
||||
bubble: result.bubble
|
||||
|
||||
@@ -71,6 +71,8 @@ export class MockContextKeyService implements IContextKeyService {
|
||||
export class MockKeybindingService implements IKeybindingService {
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
public readonly inChordMode: boolean = false;
|
||||
|
||||
public get onDidUpdateKeybindings(): Event<IKeybindingEvent> {
|
||||
return Event.None;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user