I encounter this issue almost daily. It is one of those annoyances that I wish would go away but don’t take any steps to fix. I end up hitting my keyboard shortcut to “Navigate back” to see the Parent again. Thanks for writing up the problem and requesting the feature. It would be most appreciated if devs could provide this feature.
I’ve just installed the “No Dup Leaves” plugin and it is creates exactly the Obsidian behavior I’d prefer. Thanks scambier for making this happen now via your plugin and I’ll add my vote to this Obsidian feature request.
We did some internal testing at some point about this. I understand some people like it, but the behavior is a bit jarring because sometimes you navigate in this tab and other times you move the focus somewhere else. This is also not how browsers work (nor code editors).
Another workflow trying to tackle the same problem is “reuse tab when opening in new tab”
Some code editors, like VSCode, have this behavior, and I find it jarring . Others like Jetbrains put the focus on the file if it’s already open. I agree that browsers work like that too, but a browser’s UI is different, and so is its usage
It would be nice if users could choose which behavior suits them best in Obsidian’s settings. Though from what I’ve gathered, I understand it is easier said than done.
With my current way of working, I end up with tons of open tabs of the same document, so I’d be really pleased to see this functionality added, perhaps as a configurable option as I appreciate that is may be down to personal preference.
But the crucial difference is that code editors don’t navigate within tab .
This isn’t entirely true, CTRL + clicking in VSCode on a function will navigate to the functions definition in the current tab. I personally find this very intuitive and think it would be a good fit for Obsidian, whose experience should be closer to that of an editor than to that of a browser, in my opinion.
Had Match been defined in a separate file which was already open, VSCode would have reused the tab and put focus on the Match definition. I think this behaviour should be matched in Obsidian, though gated behind the CTRL key similarly to the VSCode (and many other editors’) behaviour.
If an implementation already exists internally, perhaps it could be trialed on Insiders while gated behind a configuration flag?
As someone who prefers reading mode over live preview, this feature is gonna mess things up for me. I often open 2 panes of the same note, one in source mode and the other in reading mode. I then link the two panes so that they will scroll down together when I scroll down.
Sometimes I have to work on different parts of the same note, so having two panes is essential, especially when the note is quite long.
There are already plugins doing this, so I don’t see the need for it to be in core.
This is because you are clicking on something that is on the same file. What happens if you click on something that is on a different file? Is it opining in that tab or is it opening a new tab?
Perhaps I misunderstood the original post – if clicking on something that is in a different file the editor will reuse an existing tab of that file and put the focus on the target. If no existing tab is found, a new one will be created. A duplicate tab is never produced.
The point is this, the way browsers and IDEs handle this is very different and it’s either one or the other, because hybrid approach look odd.
I appreciate this, but at least for my use case (and @scambier’s, it appears), the IDE approach is a much better user experience. I think both can reasonably be accommodated by introducing a configuration flag. Humbly I think this could reasonably be a core functionality and not something that requires resorting to a 3rd party plugin.
Additionally it seems implementing this in a consistent way is not easily done with a 3rd party plugin using the current API. Taken from the no duped leaves plugin description:
Word of warning This plugin modifies the default behavior of Obsidian.
Internally, it overwrites the public function openLinkText(), which is called when you click on a link in a note. This also affects other plugins that use this function - like Omnisearch -, but does not work on core features like the File Explorer.
I was re-reading this, and I think there is some misunderstanding.
My hacky plugin tries to focus on one thing: not creating a new tab with a file, if that file is already opened elsewhere. Because I never need 2 different tabs with the same note. Like, ever. And even if I do, i can still ctrl+click the link. It does it imperfectly simply because I can’t properly patch the lower-level API (and risk introduce bugs).
What you describe in the post I respond to is a behavior I’m totally ok with. I hate it when opening a note (through a link, filename, or modal) replaces the active tab.
Obsidian is powerful enough to accommodate different people’s need because it’s open and not opinionated, but I always found its design choices about navigation kinda weird. I’m not asking to revamp the whole thing because it’s certainly fine for most users, but some settings like “switch to a note if it’s already open instead of opening it a second time” and “always open notes in a new tab” would be nice.