czottmann / obsidian-mononote

An Obsidian plugin that ensures each note occupies only one tab. If a note is already open, its existing tab will be focussed instead of opening the same file in the current tab.
https://obsidian.md/plugins?id=zottmann
MIT License
89 stars 2 forks source link

[ZCO-227] If a pinned file is opened again (while active), it opens a duplicate tab #1

Closed Stakker closed 8 months ago

Stakker commented 1 year ago

This is a very small issue, but I just noticed this, so thought I'd mention it anyway :-) Otherwise everything's been working smoothly so far πŸ‘

Also, it seems 1.0 was released just yesterday, so congrats! Updated my BRAT to point to it, but I guess it will be found in Community Plugins soon?

ZCO-227

czottmann commented 1 year ago

Hi @Stakker, thanks for the kind words! Yes, that issue is known, I've added a section "Known Issues" to the README a day or two ago. πŸ˜‰

1.0 is out and awaiting Community Plugin review, indeed! Fingers crossed…

saif-ellafi commented 11 months ago

This is such a must have in Obsidian, I don't understand why that default behavior they chose. Thanks for creating this.

yaozhenx commented 11 months ago

This is definitely a deal-breaker. Hope it can be fixed soon.

czottmann commented 11 months ago

I'll look into it soon β€” but truth be told, Mononote is currently not my priority project, so it might take a while.

czottmann commented 8 months ago

I'm unable to fix this at the moment. Reason:

I'll leave this ticket open for the time being and will revisit the issue in a couple of months.

czottmann commented 8 months ago

@Stakker @saif-ellafi @yaozhenx I've found a workaround which does the trick. The fix will be part of the upcoming v1.1, due soon!

yaozhenx commented 8 months ago

@czottmann Good to hear that. Mind to explain what the workaround is?

czottmann commented 8 months ago

@yaozhenx I've completely ditched the file-open handler and instead focussed on the active-leaf-change handling which fires whenever the active tab situation changes. Opening files triggers the event (if the "Always focus new tabs" setting is on), so does switching tabs. This is working well, especially since Obsidian won't fire a file-open for every file or tab it opens, it's just not sufficient for what I'm trying to achieve.

That means that for Mononote to work correctly, Settings β†’ Editor β†’ Always focus new tabs must now be enabled. More in the release notes, likely tomorrow morning.

Stakker commented 8 months ago

Awesome :-) πŸ‘