Skip to content

Commit 9a55d5c

Browse files
authored
fix: switchFile api to respect custom subtitle (#1672)
1 parent 6c88d35 commit 9a55d5c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/lib/editorFile.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,10 @@ export default class EditorFile {
944944
}
945945
}
946946

947+
get headerSubtitle() {
948+
return this.#getTitle();
949+
}
950+
947951
/**
948952
*
949953
* @param {FileAction} action

src/lib/editorManager.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,7 @@ async function EditorManager($header, $body) {
633633
if (activeFileId === id) return;
634634

635635
const file = manager.getFile(id);
636+
if (!file) return;
636637

637638
manager.activeFile?.tab.classList.remove("active");
638639

@@ -684,6 +685,7 @@ async function EditorManager($header, $body) {
684685
}
685686

686687
$header.text = file.filename;
688+
$header.subText = file.headerSubtitle || "";
687689
manager.onupdate("switch-file");
688690
events.emit("switch-file", file);
689691
}

0 commit comments

Comments
 (0)