-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: Completion doesn't trigger if abbreviation of :Lazy
command is used
#1758
Comments
Can not reproduce. Are you sure your |
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 |
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 lazy.nvim/lua/lazy/view/commands.lua Lines 147 to 156 in 460e1cd
It expects to find 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 |
You can split it on whitespace and then do It's already doing the split so just |
Problem: Command completion doesn't work if the command name isn't written in full Solution: Use vim.startswith to check if the command is a prefix of 'Lazy' Fixes folke#1758
Similarly for Trouble I believe you could do here line = line:sub(1, col):match("Tr%w*%s*(.*)$") to allow for PS: I'm not experienced in programming and neither with |
Problem: Command completion doesn't work if the command name isn't written in full Solution: Use vim.startswith to check if the command is a prefix of 'Lazy' Fixes folke#1758
Problem: Command completion doesn't work if the command name isn't written in full Solution: Use vim.startswith to check if the command is a prefix of 'Lazy' Fixes #1758
🤖 I have created a release *beep* *boop* --- ## [11.14.2](v11.14.1...v11.14.2) (2024-11-10) ### Bug Fixes * **bootstrap:** single forward slash. Fixes [#1747](#1747) ([aca30f6](aca30f6)) * **completion:** check if command string is a prefix of Lazy ([#1760](#1760)) ([e9fd76e](e9fd76e)), closes [#1758](#1758) * **docs:** always update helptags for local plugins ([60cf258](60cf258)) * **luarocks:** try to install from root manifest ([#1687](#1687)) ([591ef40](591ef40)) * **rocks:** add lib64 plugin directory to package.cpath ([#1717](#1717)) ([80da254](80da254)) * **rockspec:** allow binary lua files. Fixes [#1800](#1800) ([408449a](408449a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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 folke/trouble.nvim#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
The text was updated successfully, but these errors were encountered: