提交 71064cdf 编写于 作者: B Benjamin Pasero

fix #39713

上级 cd906f8a
......@@ -27,6 +27,7 @@ import { ResourceQueue } from 'vs/base/common/async';
import { ResourceMap } from 'vs/base/common/map';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { isCodeEditor } from 'vs/editor/browser/editorBrowser';
import { SideBySideEditor } from 'vs/workbench/browser/parts/editor/sideBySideEditor';
export class FileEditorTracker implements IWorkbenchContribution {
......@@ -263,8 +264,16 @@ export class FileEditorTracker implements IWorkbenchContribution {
editors.forEach(editor => {
const resource = toResource(editor.input, { supportSideBySide: true });
// Support side-by-side binary editors too
let isBinaryEditor = false;
if (editor instanceof SideBySideEditor) {
isBinaryEditor = editor.getMasterEditor().getId() === BINARY_FILE_EDITOR_ID;
} else {
isBinaryEditor = editor.getId() === BINARY_FILE_EDITOR_ID;
}
// Binary editor that should reload from event
if (resource && editor.getId() === BINARY_FILE_EDITOR_ID && (e.contains(resource, FileChangeType.UPDATED) || e.contains(resource, FileChangeType.ADDED))) {
if (resource && isBinaryEditor && (e.contains(resource, FileChangeType.UPDATED) || e.contains(resource, FileChangeType.ADDED))) {
this.editorService.openEditor(editor.input, { forceOpen: true, preserveFocus: true }, editor.position).done(null, errors.onUnexpectedError);
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册