Skip to content

Commit ce0a281

Browse files
authored
Merge pull request #7 from iOSonntag/copilot/fix-folder-focus-disappearing
Preserve explicit TreeFocus overrides across Obsidian reloads
2 parents 4e41235 + c172e19 commit ce0a281

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

src/core/tree-focus.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,8 @@ export class TreeFocus {
167167
*/
168168
private async performPluginCleanupTask(): Promise<void>
169169
{
170-
const allItemPaths: string[] = [];
171-
let fileExplorers = this.getFileExplorers();
172-
173-
for (let fiExplorer of fileExplorers)
174-
{
175-
FileExplorerHelper.forEveryItem(fiExplorer, (path, item) =>
176-
{
177-
allItemPaths.push(path);
178-
});
179-
}
180-
181170
const availableExplicitPaths = [...PluginSettings.getExplicitModePaths()];
182-
const orphanedExplicitPaths = availableExplicitPaths.filter((path) => allItemPaths.includes(path) === false);
171+
const orphanedExplicitPaths = availableExplicitPaths.filter((path) => this.app.vault.getAbstractFileByPath(path) === null);
183172

184173
Log.debug('orphaned explicit paths', orphanedExplicitPaths);
185174

@@ -333,4 +322,3 @@ export class TreeFocus {
333322

334323
}
335324

336-

0 commit comments

Comments
 (0)