From 76d9247f9fbea38515a3fa407c97d75fbaf4a247 Mon Sep 17 00:00:00 2001 From: Luna Saphie Mittelbach Date: Fri, 27 Sep 2024 09:31:38 +0200 Subject: [PATCH] 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 --- lua/lazy/view/commands.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazy/view/commands.lua b/lua/lazy/view/commands.lua index 9791924e..fd4af3d7 100644 --- a/lua/lazy/view/commands.lua +++ b/lua/lazy/view/commands.lua @@ -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