Skip to content

Commit b5a4806

Browse files
authored
respond to config changes of tab focus mode (microsoft#175261)
fix microsoft#174924
1 parent 6c3577d commit b5a4806

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/vs/workbench/browser/parts/editor/editorStatus.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import { ITelemetryData, ITelemetryService } from 'vs/platform/telemetry/common/
5353
import { SideBySideEditorInput } from 'vs/workbench/common/editor/sideBySideEditorInput';
5454
import { AutomaticLanguageDetectionLikelyWrongClassification, AutomaticLanguageDetectionLikelyWrongId, IAutomaticLanguageDetectionLikelyWrongData, ILanguageDetectionService } from 'vs/workbench/services/languageDetection/common/languageDetectionWorkerService';
5555
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
56+
import { TerminalSettingId } from 'vs/platform/terminal/common/terminal';
5657

5758
class SideBySideEditorEncodingSupport implements IEncodingSupport {
5859
constructor(private primary: IEncodingSupport, private secondary: IEncodingSupport) { }
@@ -308,7 +309,8 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
308309
@ITextFileService private readonly textFileService: ITextFileService,
309310
@IStatusbarService private readonly statusbarService: IStatusbarService,
310311
@IInstantiationService private readonly instantiationService: IInstantiationService,
311-
@IContextKeyService private readonly contextKeyService: IContextKeyService
312+
@IContextKeyService private readonly contextKeyService: IContextKeyService,
313+
@IConfigurationService private readonly configurationService: IConfigurationService
312314
) {
313315
super();
314316

@@ -334,6 +336,15 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
334336
this.onTabFocusModeChange();
335337
}
336338
}));
339+
this._register(this.configurationService.onDidChangeConfiguration(e => {
340+
if (e.affectsConfiguration('editor.tabFocusMode')) {
341+
TabFocus.setTabFocusMode(this.configurationService.getValue('editor.tabFocusMode'), TabFocusContext.Editor);
342+
this.onTabFocusModeChange();
343+
} else if (e.affectsConfiguration(TerminalSettingId.TabFocusMode)) {
344+
TabFocus.setTabFocusMode(this.configurationService.getValue(TerminalSettingId.TabFocusMode), TabFocusContext.Terminal);
345+
this.onTabFocusModeChange();
346+
}
347+
}));
337348
}
338349

339350
private registerCommands(): void {
@@ -833,7 +844,6 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
833844

834845
private onTabFocusModeChange(): void {
835846
const info: StateDelta = { type: 'tabFocusMode', tabFocusMode: TabFocus.getTabFocusMode(this.contextKeyService.getContextKeyValue('focusedView') === 'terminal' ? TabFocusContext.Terminal : TabFocusContext.Editor) };
836-
837847
this.updateState(info);
838848
}
839849

0 commit comments

Comments
 (0)