krisajenkins / evil-tabs

Integrating Vim-style tabs for Evil mode users.
MIT License
66 stars 11 forks source link

Quitting a window with ":q" results in killing the whole tab #16

Open kinnala opened 9 years ago

kinnala commented 9 years ago

If you open multiple windows inside a tab, i.e.,

:tabnew :vsplit :split

and try to close a single window with ":q" you end up closing the whole tab. This differs from the behavior of Vim where only the current window is closed. Currently as a workaround I added

(evil-define-command evil-tab-sensitive-quit (&optional bang)
   :repeat nil
   (interactive "<!>")
   (if (> (length (elscreen-get-screen-list)) 1)
       (if (> (count-window) 1)
           (evil-quit)
           (elscreen-kill))
       (evil-quit bang)))

to my initfile. It should probably be investigated whether this is enough.

quaker4lyf commented 8 years ago

I can repro this as well: 1) :tabe[RET] 2) :split[RET] 3) :q[RET] I observe tab is gone.

However, in step (3), if instead of ":q[RET]" I use "ZQ", it does the correct behaviour of only closing the current window. The same is true for "[M-x]evil-quit[RET]".

":q" should be mapped to evil-quit, yet obviously there's something else going on here. So I'm not sure if the bug is in evil or evil-tabs.

Edit: not using angle brackets cuz of markdown.