Closed l2eused closed 1 month ago
for middle click is fine.
I think it related to this
so the problem is when I load N1
that already open in T2
, it should switch to T2
and remains old note in T1
. but in my case, tab isn't focused to T2
and loop T1 -> T2 -> T1
more info: this issue also happens when I left click in wikilinks to...
Thanks for the report, @l2eused!
I'm quite sure it's a race condition. The way Obsidian signals tab switching internally made it necessary to implement some time-based guess work in Mononote. In a nutshell: For some operations, Mononote simply waits for 100ms before applying its own tab switching rules, to give Obsidian time to work things out. If it isn't enough time, then Mononote will switch tabs from T1 to T2 before Obsidian is done, and once Obsidian is done, the app itself switches back to T1.
I suspected that depending on your machine and your vault size, 100ms might not be enough time. Raising that number too much, however, might be annoying for people with fast machines and small vaults – so I tried to find a good middle ground.
I'll add a settings page in the next release that lets you configure your sweet spot, which should mitigate the issue you're seeing!
Give Release 1.2.2 · czottmann/obsidian-mononote a spin, and try increasing the delay configuration:
If that doesn't do the trick, please re-open this ticket! 🖖🏼
Yes, that work for me. I just realize that I only have this problem when I tried to switch to large note that have many embed and online image. so I increase delay to 300ms and it work fine now, little of delay but I can deal with this and it much better than loop switch...
btw, thanks for really fast reply and fix!
step to reproduce:
A
noteB
note in new tabA
note to open in same tab (currently isB
note in tab)actual behavior:
B
note in tab will switch toA
note tab and switch back...expected behavior: it should switch to
A
note tab and shouldn't switch it back.https://github.com/czottmann/obsidian-mononote/assets/94383254/e8d1c4d9-f9d8-4fca-885b-8fc955a1242a
platforms: windows 10 obsidian 1.6.3 mononote 1.2.1
this is all my plugin...