alpha-nvim icon indicating copy to clipboard operation
alpha-nvim copied to clipboard

:Alpha recognizes non-arguments as arguments

Open ObsidianChickenz opened this issue 3 years ago • 5 comments

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 avatar Apr 29 '22 22:04 ObsidianChickenz

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 avatar Apr 30 '22 16:04 ObsidianChickenz

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 avatar Apr 30 '22 17:04 ObsidianChickenz

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

ObsidianChickenz avatar May 01 '22 13:05 ObsidianChickenz

I should still probably try to fix the Alpha command

goolord avatar May 03 '22 00:05 goolord

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

ObsidianChickenz avatar May 03 '22 13:05 ObsidianChickenz

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

needed the "bar" flag to be set

goolord avatar Feb 14 '23 20:02 goolord