Skip to content

Commit

Permalink
fix(completion): check if command string is a prefix of Lazy (#1760)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
LunarLambda authored Oct 2, 2024
1 parent 460e1cd commit e9fd76e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/lazy/view/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e9fd76e

Please sign in to comment.