Skip to content

Commit

Permalink
fix(completion): Check if command string is a prefix of Lazy
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 folke#1758
  • Loading branch information
LunarLambda committed Sep 27, 2024
1 parent 460e1cd commit b56b5a2
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 b56b5a2

Please sign in to comment.