Unintentionally opening same file in two tabs

When having many open file tabs and searching for a file with CTRL+O, then it’s easy to get into a situation where the same file unintentionally is open in multiple tabs.

Steps to reproduce

  1. Given John has two open files - “Foo” and “Bar” (“View #1 into file”)
  2. And file tab “Foo” is active
  3. When John is pressing CTRL+O to open “Bar” (in the “Foo” tab)
  4. Then “Bar” is also opened in this tab (“View #2 into file”) - as a result, “Bar” is now open in two tabs
  5. And “Foo” is no longer open

Expected result

  • Give the user a warning (“Tab is already open - do you want to switch to the open tab?”), and/or:
  • Automatically redirect the user to the open tab (sometimes, the user might want to open two views into the same file)

To detail the expected result:

  1. Given John has two open files - “Foo” and “Bar” (“View #1 into file”)
  2. And file tab “Foo” is active
  3. When John is pressing CTRL+O to open “Bar” (in the “Foo” tab)
  4. Then Obsidian informs John that “Bar” is already open in another tab and asks, “Switch to tab?”
  5. When John chooses to switch to tab “Bar”:
    1. Then John is redirected to tab “Bar”
    2. And tabs “Foo” and “Bar” are now open
  6. When John chooses not to switch to tab “Bar”:
    1. Then a new view into file “Bar” is opened in a separate tab (as today)
    2. And tab “Bar” is now opened in two tabs
    3. And tab “Foo” is closed

Environment

Version: 1.1.9
Windows 10

Screenshot of the start situation:

PS: When attempting to open the same file twice in Word, then Word redirects user to the open file instance.