提交 a826f536 编写于 作者: B Benjamin Pasero

Stop changing selection when autoreveal is off (fixes #14745)

上级 24d2d511
......@@ -258,7 +258,7 @@ configurationRegistry.registerConfiguration({
},
'explorer.autoReveal': {
'type': 'boolean',
'description': nls.localize('autoReveal', "Controls if the explorer should automatically reveal files when opening them."),
'description': nls.localize('autoReveal', "Controls if the explorer should automatically reveal and select files when opening them."),
'default': true
},
'explorer.enableDragAndDrop': {
......
......@@ -157,6 +157,10 @@ export class ExplorerView extends CollapsibleViewletView {
}
private onEditorsChanged(): void {
if (!this.autoReveal) {
return; // do not touch selection or focus if autoReveal === false
}
const activeInput = this.editorService.getActiveEditorInput();
let clearSelection = true;
let clearFocus = false;
......@@ -251,7 +255,12 @@ export class ExplorerView extends CollapsibleViewletView {
this.shouldRefresh = false; // Reset flag
}
if (!this.autoReveal) {
return refreshPromise; // do not react to setVisible call if autoReveal === false
}
// Always select the current navigated file in explorer if input is file editor input
// unless autoReveal is set to false
const activeResource = this.getActiveEditorInputResource();
if (activeResource) {
return refreshPromise.then(() => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册