fix(completion): check if command string is a prefix of Lazy

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
This commit is contained in:
Luna Saphie Mittelbach 2024-09-27 09:31:38 +02:00
commit 76d9247f9f
No known key found for this signature in database

View file

@ -146,7 +146,7 @@ end
---@return string, string[]
function M.parse(args)
local parts = vim.split(vim.trim(args), "%s+")
if parts[1]:find("Lazy") then
if vim.startswith("Lazy", parts[1]) then
table.remove(parts, 1)
end
if args:sub(-1) == " " then