Support for opening Neogit in new tabpage before current tabpage, instead of after.
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 5.6k
- Forks
- 357
- Avg merge
- 15h 47m
- Merged PRs (30d)
- 2
Description
Is your feature request related to a problem? Please describe.
I make heavy use of tabpages, usually with different cwd set (frontend, backend, etc).
If I activate neogit while Tab 1 is active, it opens between Tab 1 and Tab 2. Then, when I close neogit, Tab 2 takes over as active instead of Tab 1.
Super minor gripe, I know, just finally hit the point where it had bothered me enough to open an issue request for it.
Describe the solution you'd like
When neogit is opened as a new tabpage, it should open before the current tabpage, instead of after.
Desired behavior would be:
User has two tabs open (Tab 1 and Tab 2), with Tab 1 active.
User opens neogit as in a new tab, and the new tab is inserted before Tab 1.
When the user closes neogit, default neovim behavior activates the next tab, which brings the user back to Tab 1 (same tab they were originally in)
Describe alternatives you've considered
It might be better to save the tab that was opened prior to neogit being opened in a new tabpage, and then activating explicitly when neogit is closed. This approach would be more complex, with more need to handle edge cases (what should happen when the original tab is closed?).
Another alternative is to keep the tab ordering as it currently works, but to override the default neovim behavior by manually activating the previous tab instead of the next tab when neogit is closed.
Additional context
I am more than happy to open a pull request for either approach. My preference would be to just open the new tabpage before the current, and let neovim handle the rest automatically.
Since it changes current behavior, I can also put it behind a configuration option that defaults to false, but I think the current behavior is intuitive enough that I can't imagine anyone wanting the option to keep it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the code path that opens Neogit as a new tabpage and inspect how Neovim inserts the new tab relative to the current one. Done means a Neogit tab opens before the active tab, so closing it returns to the tab that was originally active; verify this with the existing tabpage behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, lua
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100