otavioschwanck / arrow.nvim

Bookmark your files, separated by project, and quickly navigate through them.
Other
454 stars 19 forks source link

The `separate_by_branch = true` option does not separate #20

Closed sQVe closed 5 months ago

sQVe commented 6 months ago

Hey, 👋

Most importantly, thank you for you an excellent plugin! ❤️

I'm trying to separate my bookmarks between branches, and having troubles getting it to work. Setting the separate_by_branch option to either false or true does nothing.

🍻

sbyang commented 5 months ago

Good plugin, but same issue.

otavioschwanck commented 5 months ago

Hey, 👋

Most importantly, thank you for you an excellent plugin! ❤️

I'm trying to separate my bookmarks between branches, and having troubles getting it to work. Setting the separate_by_branch option to either false or true does nothing.

🍻

  1. how did you setup arrow?

  2. could you try to run inside a project in neovim:

:lua = require("arrow.git").get_git_branch() and see if is returning the right branch.

Observation: if you are using some session manager, it can mess arrow. Check:

https://github.com/otavioschwanck/arrow.nvim?tab=readme-ov-file#working-with-sessions-plugins

cbochs commented 5 months ago

@otavioschwanck I'm guessing the issue may be due to this line. It assumes the user's current directory has a .git subdirectory. However, navigating into any subdirectories of a repo will cause that check to fail. It may be better to use [:h vim.fs.find](https://neovim.io/doc/user/lua.html#vim.fs.find()) to search for .git instead. This is what grapple.nvim does.

otavioschwanck commented 5 months ago

@otavioschwanck I'm guessing the issue may be due to this line. It assumes the user's current directory has a .git subdirectory. However, navigating into any subdirectories of a repo will cause that check to fail. It may be better to use [:h vim.fs.find](https://neovim.io/doc/user/lua.html#vim.fs.find()) to search for .git instead. This is what grapple.nvim does.

done: https://github.com/otavioschwanck/arrow.nvim/commit/efad6908abe10d7d74b24c203ad62e51662522a2

@sQVe could you test it?

sQVe commented 5 months ago

@otavioschwanck It seems to work consistently now.

The issue was a bit weird before - something it worked, and sometimes not. Seems like it should be related to the issue mentioned by @cbochs.

sbyang commented 5 months ago

Wow, that was quick. It works well now. Thank you!