goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.78k stars 104 forks source link

Toggling dashboard closes windows #191

Closed kiil closed 1 year ago

kiil commented 1 year ago

Minor annoyance:

When toggling the alpha dashboard in a window, toggling back away from the home dashboard will also close the window unless there is only one window open.

My workaround so far is to open the dashboard normally in the selected window, and then using ctrl + 6 (alternative file) to get back to the buffer I was working on in the same window, without closing my selected window.

Steps to Reproduce

  1. Open two buffers
  2. Make a split
  3. Place a buffer in each split
  4. from either of the windows open alpha dashboard
  5. Then toggle it
  6. The window will close, leaving only one window open

Expected behavior

I would expect toggling the home dashboard to not close windows.

goolord commented 1 year ago

i'm not sure, i'm on the fence. the current behavior is like :bd, which is perhaps more vim-like, but it does feel a bit unexpected

goolord commented 1 year ago

what buffer would you expect to open to? (in pseudocode) all_buffers[1]? scratch_buffer?

kiil commented 1 year ago

I would expect it to "reopen" whatever buffer was displayed in the window before toggling the dashboard - sort of like using ctrl + 6 to open the alternate buffer again.

goolord commented 1 year ago

yeah that seems good. i'll implement that as soon as i can get to it

kiil commented 1 year ago

Thank you.

goolord commented 1 year ago

done https://github.com/goolord/alpha-nvim/commit/3847d6baf74da61e57a13e071d8ca185f104dc96