Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:ObsidianFollowLink won't navigate to a note in a subfolder #332

Closed
nref opened this issue Jan 17, 2024 · 5 comments
Closed

:ObsidianFollowLink won't navigate to a note in a subfolder #332

nref opened this issue Jan 17, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@nref
Copy link

nref commented Jan 17, 2024

🐛 Describe the bug

Maybe it's me and not the extension, but with the default configuration, :ObsidianFollowLink to an existing note in another folder offers to create a new note.

Repro:

Given this structure:

note1.md
folder/
    note2.md

and

// in note1.md
[[note2]]

Placing the cursor on [[note2]] and invoking :ObsidianFollowLink results in the offer Create new note 'note2'? [Y/n]. I expected to navigate to the existing note folder/note2.md

repro.zip

Versions

PS C:\Users\doug> nvim --version
NVIM v0.9.4
Build type: RelWithDebInfo
LuaJIT 2.1.1696883897
Compilation: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe /MD /Zi /O2 /Ob1  -W3 -wd4311 -wd4146 -DUNIT_TESTING -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_WIN32_WINNT=0x0602 -DMSWIN -DINCLUDE_GENERATED_DECLARATIONS -ID:/a/neovim/neovim/.deps/usr/include/luajit-2.1 -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/build/src/nvim/auto -ID:/a/neovim/neovim/build/include -ID:/a/neovim/neovim/build/cmake.config -ID:/a/neovim/neovim/src -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include

   system vimrc file: "$VIM\sysinit.vim"
  fall-back for $VIM: "C:/Program Files (x86)/nvim/share/nvim"

Run :checkhealth for more info
PS C:\Users\doug> nvim --headless -c 'lua require("obsidian").info()' -c q

[obsidian.nvim (v2.6.1)] Commit SHA: a9ae6b20560d716a5f9b89252e4ea29c8e64617a
[plenary.nvim] Commit SHA: 50012918b2fc8357b87cff2a7f7f0446e47da174
[nvim-cmp] Commit SHA: 538e37ba87284942c1d76ed38dd497e54e65b891
ripgrep 14.0.3 (rev 67ad9917ad)
@nref nref added the bug Something isn't working label Jan 17, 2024
@epwalsh
Copy link
Owner

epwalsh commented Jan 17, 2024

@nref thank you! I was able to repro and I'm working on a fix. In the meantime, if you were to set notes_subdir = "folder" in your obsidian.nvim config, that would fix the issue.

@nref
Copy link
Author

nref commented Jan 17, 2024

Ok, thanks! My folder structure is too many and changing to do that systematically, but I'll keep that in mind.

@epwalsh
Copy link
Owner

epwalsh commented Jan 17, 2024

UPDATE: @nref my repro was actually a false positive. It is working correctly for me. Can you post your obsidian.nvim config? Also, were there any error messages in :messages?

@nref
Copy link
Author

nref commented Jan 17, 2024

I don't understand, but it's working now. In case something was cached I created a new repro folder with a new name. Sorry, but thanks for your time. I'll close this.

@nref nref closed this as completed Jan 17, 2024
@nref
Copy link
Author

nref commented Jan 17, 2024

As a side note, it works regardless of what's in the workspaces in config.

return {
  "epwalsh/obsidian.nvim",
  version = "*",  -- recommended, use latest release instead of latest commit
  lazy = true,
  ft = "markdown",
  dependencies = {
    -- Required.
    "nvim-lua/plenary.nvim",
  },
  opts = {
    workspaces = {
      {
        name = "personal",
        -- works without this too
        path = "C:\\Users\\doug\\Desktop\\repro",
      },
    },
  },
}

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

No branches or pull requests

2 participants