Skip to content

Commit

Permalink
"Convert Indentation to {tabs,spaces}" only effects auxwindow (fix #2…
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Feb 19, 2024
1 parent 9b0d743 commit 6e6c85d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
1 change: 0 additions & 1 deletion src/vs/platform/hover/browser/hover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ export class WorkbenchHoverDelegate extends Disposable implements IHoverDelegate
private lastHoverHideTime = Number.MAX_VALUE;
private timeLimit = 200;


private _delay: number;
get delay(): number {
if (this.instantHover && Date.now() - this.lastHoverHideTime < this.timeLimit) {
Expand Down
3 changes: 1 addition & 2 deletions src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,7 @@ export class BreadcrumbsControl {
@IEditorService private readonly _editorService: IEditorService,
@ILabelService private readonly _labelService: ILabelService,
@IConfigurationService configurationService: IConfigurationService,
@IBreadcrumbsService breadcrumbsService: IBreadcrumbsService,
@IInstantiationService instantiationService: IInstantiationService,
@IBreadcrumbsService breadcrumbsService: IBreadcrumbsService
) {
this.domNode = document.createElement('div');
this.domNode.classList.add('breadcrumbs-control');
Expand Down
5 changes: 2 additions & 3 deletions src/vs/workbench/browser/parts/editor/editorStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,9 @@ class EditorStatus extends Disposable {
}

private registerCommands(): void {
CommandsRegistry.registerCommand({ id: 'changeEditorIndentation', handler: () => this.showIndentationPicker() });
CommandsRegistry.registerCommand({ id: `changeEditorIndentation${this.targetWindowId}`, handler: () => this.showIndentationPicker() });
}


private async showIndentationPicker(): Promise<unknown> {
const activeTextEditorControl = getCodeEditor(this.editorService.activeTextEditorControl);
if (!activeTextEditorControl) {
Expand Down Expand Up @@ -483,7 +482,7 @@ class EditorStatus extends Disposable {
text,
ariaLabel: text,
tooltip: localize('selectIndentation', "Select Indentation"),
command: 'changeEditorIndentation'
command: `changeEditorIndentation${this.targetWindowId}`
};

this.updateElement(this.indentationElement, props, 'status.editor.indentation', StatusbarAlignment.RIGHT, 100.4);
Expand Down
21 changes: 9 additions & 12 deletions src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,14 @@ class StatusbarPart extends Part implements IStatusbarEntryContainer {
private leftItemsContainer: HTMLElement | undefined;
private rightItemsContainer: HTMLElement | undefined;


private readonly hoverDelegate: WorkbenchHoverDelegate;
private readonly hoverDelegate = this._register(this.instantiationService.createInstance(WorkbenchHoverDelegate, 'element', true, (_, focus?: boolean) => (
{
persistence: {
hideOnKeyDown: true,
sticky: focus
}
}
)));

private readonly compactEntriesDisposable = this._register(new MutableDisposable<DisposableStore>());
private readonly styleOverrides = new Set<IStatusbarStyleOverride>();
Expand All @@ -149,20 +155,11 @@ class StatusbarPart extends Part implements IStatusbarEntryContainer {
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
@IStorageService private readonly storageService: IStorageService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IContextMenuService private contextMenuService: IContextMenuService,
@IContextMenuService private readonly contextMenuService: IContextMenuService,
@IContextKeyService private readonly contextKeyService: IContextKeyService,
) {
super(id, { hasTitle: false }, themeService, storageService, layoutService);

this.hoverDelegate = this._register(instantiationService.createInstance(WorkbenchHoverDelegate, 'element', true, (_, focus?: boolean) => (
{
persistence: {
hideOnKeyDown: true,
sticky: focus
}
}
)));

this.registerListeners();
}

Expand Down

0 comments on commit 6e6c85d

Please sign in to comment.