Open LunarLambda opened 6 days ago
Can not reproduce. Are you sure your <Tab>
key is not remapped to something else? You can check it via :imap <Tab>
.
Shouldn't be, it reproduced on that version of Neovim with the latest master of lazy.nvim with the repro.lua suggested by the issue template. Plus imap is for insert mode, not command line mode, iirc.
are you sure this is a lazy bug and not upstream?
@b0ae989c he should use :cmap
if at all
I think you didn't see the space after the :La
you don't get completions for e.g. clear
, show
, debug
, etc
It's not an upstream bug. See the trouble.nvim bug I linked in the issue, where the same thing occurs, except the completion code inside of trouble throws an error instead of doing nothing, like here.
It's the parse
command
It expects to find Lazy
as the first argument, which then removes it from parts
and expands on the sub-commands. If we change on line 149 to be a pattern of Lazy
, so for example if parts[1]:find("Laz?y?")
, then it seems to work as OP wanted.
Not sure if I'm missing something with the pattern I chose. Maybe someone else can come up with a better pattern? Theoretically the pattern above would also match "Lay", but there's no such command and I didn't observe any inconsistencies when typing La <tab>
or Laz <tab>
.
You can split it on whitespace and then do vim.startswith("Lazy", command)
. By reversing the argument order you're basically asking if command
is a prefix of Lazy
It's already doing the split so just vim.startswith("Lazy", parts[1])
would do it.
@LunarLambda
Similarly for Trouble I believe you could do here
line = line:sub(1, col):match("Tr%w*%s*(.*)$")
to allow for Trouble
abbreviations.
PS: I'm not experienced in programming and neither with lazy.nvim
or Trouble
codebases, hence I'm hesitant to create PR. I'm just leaving it here for you and Folke to see. Maybe there's a better way to do it and I'm missing something else that might create a conflict.
Did you check docs and existing issues?
Neovim version (nvim -v)
NVIM v0.11.0-dev-825+gd831392b1
Operating system/version
Arch Linux
Describe the bug
Identical bug as https://github.com/folke/trouble.nvim/issues/580, but when typing
:La <tab>
, or:Laz <tab>
, instead of an error completion simply does not trigger at all, even though:La<cr>
does open Lazy. Completion only works with:Lazy <tab>
.Steps To Reproduce
Type
:Laz <tab>
Expected Behavior
Completion should work even if an abbreviated prefix of the command is used.
Repro