goolord / alpha-nvim

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

:Alpha recognizes non-arguments as arguments #107

Closed ObsidianChickenz closed 1 year ago

ObsidianChickenz commented 2 years ago

Whenever I send :Alpha | bd! #, I get an E488: Trailing characters error. Oddly enough, when I send the two commands separately, everything works perfectly as expected.

Expected behavior: Sending :Alpha | bd! # should switch to Alpha, then close the buffer that was just open. Actual behavior: I get an error, E488: Trailing characters.

If this is just me being stupid somehow, please let me know, but having this work as one command is part of a keybind I frequently used with Dashboard, and it would be nice to be able to use it with Alpha.

ObsidianChickenz commented 2 years ago

A discovery: I can't run :Alpha with ANY other command. My hunch is that any time Neovim sees anything after the :Alpha command, it registers it as an argument to the command instead of as a separate command. This is just a hunch, though.

ObsidianChickenz commented 2 years ago

Since :Alpha actually just runs :lua require'alpha'.start(false), I think that Neovim is trying to run :bd! # (or any other command afterwards) as Lua instead of Vimscript. I'll see if it's possible to escape the :lua command.

ObsidianChickenz commented 2 years ago

This can be solved by running :execute "Alpha" instead.

goolord commented 2 years ago

I should still probably try to fix the Alpha command

ObsidianChickenz commented 2 years ago

I found that the issue exists in NvimTree as well, so it may be an issue with Neovim, not this plugin in particular.

goolord commented 1 year ago

fixed in https://github.com/goolord/alpha-nvim/commit/d35b99e36e32040ba06c48a25b5bd3e75be2a566

needed the "bar" flag to be set