MCPcopy Create free account
hub / github.com/UNLINEARITY/Obsidian-CodeSpace / updateTitle

Method updateTitle

src/code_view.ts:999–1011  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

997
998 // 更新标题显示未保存状态
999 updateTitle() {
1000 if (!this.file) return;
1001
1002 // 只在状态改变时更新 DOM
1003 const titleEl = this.containerEl.querySelector('.view-header-title');
1004 if (titleEl) {
1005 const title = this.isDirty ? `${this.file.name} ●` : this.file.name;
1006 // 只在标题真的改变时才更新 DOM
1007 if (titleEl.textContent !== title) {
1008 titleEl.textContent = title;
1009 }
1010 }
1011 }
1012
1013 async onLoadFile(file: TFile): Promise<void> {
1014 await super.onLoadFile(file);

Callers 4

saveMethod · 0.95
onLoadFileMethod · 0.95
initCodeMirrorMethod · 0.95
loadFileContentMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected