Replies: 2 comments 1 reply
-
Maybe what I'm asking for, in simple terms, is a way to have a separate NeoGit instance per-repository |
Beta Was this translation helpful? Give feedback.
-
Yeah, so I made a dumb decision a while back to treat out our internal representation of the repository state as a singleton. This simplified some things, but made handling multiple neogit instances per neovim process kinda broken. I have a plan to fix this pretty soon, just wrapping up another project first :) If its something you wanna look at, be my guest. Just base the work off the "nightly" branch, not master. I think the change needed is to maintain a table of repo's keyed by the CWD value. Same with watchers, and same with status buffer. The idea being to ensure only -one- instance is allowed of each, but per working directory. Status buffer and watcher should be easier as there is only one place each is created, but there are a lot of callers of "git.repo" that will need to be updated slightly. The pattern I've started is an "instance()" function that returns the CWD's instance. Basically I want to hide that logic from callers and just give them the right thing. If that sounds fun, then I'll be happy to advise/assist you :) |
Beta Was this translation helpful? Give feedback.
-
How I use tab pages is different than how NeoGit assumes I will use tab pages, namely, I have a tab page for each project that I'm working on. Each tab has it's own base directory, so that when I open telescope, it only shows files for that project.
If I open NeoGit in a tab page (and therefore, a project), with
kind='auto'
or something like that, and then I go to another tab page and I want to open NeoGit for that project, it is not possible, because there can only be one instance of NeoGit, and it's already open on another tab page. I had to implement this function to close all open neogit buffers in other tabs so that a new instance will open in the new tab. Without this, it appears as though nothing happens, the NeoGit instance in the other tab page just refreshes to the directory of the second project, but there is no indication that this has happened.I'm wondering what the feasibility would be to optionally allow binding a NeoGit instance to an arbitrary value so that I can bind instances of it to each tab page. I could possibly look into making a PR for it depending on what you feel the level of difficulty would be?
Beta Was this translation helpful? Give feedback.
All reactions