Open EarthyOrange opened 3 months ago
Not a bug - that's how it works on master. However, I've improved the experience a lot on the nightly
branch, which will be released with nvim 0.10. Better CWD handling, that sort of thing. Try it out :)
@CKolkey did try that myself, i have kind=tab, seems like if you already have an opened neogit status in a tab, if you call Neogit cwd=... again the neogit tab is not focused (but if you manually go to the tab it seems the state is updated). Tried on nightly with .setup()
call.
Is there a way allowing us to have multiple tabs opened for git status each for unique cwd ? I have a similar use case as the OP, where i might have multiple files from multiple working directories opened in the current nvim window. So instead of updaing the current neogit tab status if it exists, it will open a new tab for the cwd, if a tab for that cwd exists, then it can be focused and updated (working similarly to what is intended atm) - could be an opt in. Not sure how it would work with kind=split, but this could be only applicable for kind=tab wdyt ?
It's going to require a bit of doing.. I use vim.uv.getcwd()
all over to find the correct status buffer instance and repository object. I'm beginning to think that relying on that was a mistake in the first place as it's effectively a global variable. It's no issue to run git against a specific directory with the -C
flag, but what I need to do is start passing the CWD into pretty much every constructor function, so it can either be consumed (run a git command) or passed on to a buffer that would consume it.
Not a huge change, I think, but a bit tedious. However, it would mean that tabs/splits/whatever could point to a project directory and all coexist. I'd happily accept a PR if anyone wants to tackle this, otherwise I'll probably get to it at some point, but I couldn't say when.
Description
I want to open multiple Neogit tabs (https://neovim.io/doc/user/tabpage.html) in 1 Neovim window but every time I run the command
:tab Neogit cwd=<git dir>
, the new git directory is opened in the current tab. Therefore, I can run only 1 instance of Neogit in 1 window.Neovim version
NVIM v0.9.4 Build type: Release LuaJIT 2.1.0-beta3
Operating system and version
macOS 13.6.4
Steps to reproduce
:Neogit cwd=<git-dir-1>
:tab Neogit cwd=<git-dir-2>
Expected behavior
There should be 2 Neogit tabs pointing to respective git directories.
Actual behavior
On nvim run
:Neogit cwd=<git-dir-1>
:On nvim run
:tab Neogit cwd=<git-dir-2>
:Minimal config