goolord / alpha-nvim

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

fix: wrong activation condition for alpha-nvim #47

Closed jdhao closed 2 years ago

jdhao commented 3 years ago

I have abstracted the loading condition for alpha-nvim into a separate function. There are basically two conditions:

  1. If the user have provided some file to nvim
  2. The user does not provide a file, but uses some command line options. In this case, for some of the command line options, it is still valid to show alpah-nvim startup sceen. For example, for option -n (no swap file), -i (use a certain shada file) etc. Though the exact condition can be debated and I am open to suggestions and corrections.

I have also removed the vim.o.modifiable check since nvim does not support -y option and this is a nvim-only lua plugin, which does not support Vim.

On a side note, alpha-nvim used a non-conventional 4-space indentation, which makes it a little painful to work with since 2-space indentation seems that main stream 😿

jdhao commented 2 years ago

@goolord Can you give a review of my PR?

goolord commented 2 years ago

lgtm, i just want to test it at some point. i will consider either using a lua formatter or maybe just an EDITORCONFIG file to make alpha easier to hack on, ty for your input

goolord commented 2 years ago

sorry if it takes me a minute, life has been a bit hectic for me so please be patient with me 🖤

jdhao commented 2 years ago

@goolord Thanks for your prompt reply. Let me know if I need to change to get this PR merged ❤️

goolord commented 2 years ago

ok i tested it and it seemingly works as intended, i may mess with it at some point but i think this is a pretty good set of conditions. thanks for the contribution <3