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

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-10-02 09:52:51 +02:00 committed by GitHub
parent 460e1cd8f2
commit e9fd76e239
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -146,7 +146,7 @@ end
---@return string, string[] ---@return string, string[]
function M.parse(args) function M.parse(args)
local parts = vim.split(vim.trim(args), "%s+") 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) table.remove(parts, 1)
end end
if args:sub(-1) == " " then if args:sub(-1) == " " then