NeogitOrg / neogit

An interactive and powerful Git interface for Neovim, inspired by Magit
MIT License
4.1k stars 242 forks source link

Quitting a Neogit tab should focus previously focused tab #1420

Closed nikosbatsaras closed 4 months ago

nikosbatsaras commented 4 months ago

Is your feature request related to a problem? Please describe. I like to open several tabs when I'm working. Sometimes I'm really focused in one of them (let's say on the far left of the tab bar) and I want to do something quick with Git (i.e. Neogit). After I complete my operation and [q]uit Neogit, the focus is on the last tab, on the far right. It's off-putting to search and go back to where I was, kind of losing train of thought for a moment.

Describe the solution you'd like I would like to be back to where I was (previously focused tab) when I quit Neogit.

Additional context In order to reproduce:

  1. Open a file (Tab1)
  2. Open another file (Tab2)
  3. Focus Tab1
  4. :Neogit
  5. [q]uit Neogit

The focus is on Tab2. This issue escalates when multiple tabs are open and you are deeply focused in one of them.

CKolkey commented 4 months ago

Not sure how much I can do here - all I do is call :tabclose. According to the docs

When a tab is closed the next tab page will become the current one. This behaviour can be customized using the 'tabclose' option.

You could try setting tabclose to uselast, that might do it.

asmodeus812 commented 3 months ago

This does not exist on nvim 0.10 btw, is it removed or newer option ?