Skip to content

fix: update icon property on file modify & leaf open#121

Merged
gfxholo merged 2 commits intogfxholo:mainfrom
Nsbx:main
Jun 22, 2025
Merged

fix: update icon property on file modify & leaf open#121
gfxholo merged 2 commits intogfxholo:mainfrom
Nsbx:main

Conversation

@Nsbx
Copy link
Copy Markdown
Contributor

@Nsbx Nsbx commented May 30, 2025

Fix for : #88

I tested many cases, and this work well.

Tell me if the commit name, or event "position" doesn't fit

@gfxholo
Copy link
Copy Markdown
Owner

gfxholo commented Jun 13, 2025

Hi nbsx, I just got time to test out these changes 💚 Thank you for the fix! Looks like this eliminates the property bug.

this.registerEvent(this.app.vault.on('modify', tAbstractFile => {
    ...
    ...
    // If we add a new property to a file, refresh property icons
    this.editorIconManager?.refreshIcons();
}

Since this extra code only affects the properties box, can you cut this line out of IconicPlugin.ts and paste it into EditorIconManager.ts as its own callback? Just below active-leaf-change is a good position.

This also avoids a tiny merge conflict with #115, which is fixing some code at the same location in IconicPlugin.ts.

@gfxholo gfxholo self-assigned this Jun 13, 2025
@gfxholo gfxholo added the bug Something isn't working label Jun 13, 2025
@gfxholo gfxholo added this to the 1.1.2 milestone Jun 13, 2025
@gfxholo gfxholo merged commit c6b6160 into gfxholo:main Jun 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants