提交 3e2b7c71 编写于 作者: B Benjamin Pasero

fix a bug where the encoding indicator can get lost in the status bar

上级 ac9540de
......@@ -359,8 +359,14 @@ export class EditorStatus implements IStatusbarItem {
this.updateState(info);
}
private onResourceEncodingChange(r: uri): void {
this.onEncodingChange(this.getActiveEditor(r));
private onResourceEncodingChange(resource: uri): void {
let activeEditor = this.editorService.getActiveEditor();
if (activeEditor) {
let activeResource = getUntitledOrFileResource(activeEditor.input, true);
if (activeResource && activeResource.toString() === resource.toString()) {
return this.onEncodingChange(<BaseEditor>activeEditor); // only update if the encoding changed for the active resource
}
}
}
private onTabFocusModeChange(e: BaseEditor): void {
......@@ -383,18 +389,6 @@ export class EditorStatus implements IStatusbarItem {
return activeEditor && e && activeEditor === e;
}
private getActiveEditor(resource: uri): BaseEditor {
let activeEditor = this.editorService.getActiveEditor();
if (activeEditor) {
let r = getUntitledOrFileResource(activeEditor.input, true);
if (r && r.toString() === resource.toString()) {
return <BaseEditor>activeEditor;
}
}
return null;
}
}
function isCodeEditorWithTabFocusMode(e: BaseTextEditor): boolean {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册