Skip to content

Commit f125a7d

Browse files
authored
fix(commands): completion error (#819)
When Lazy commands are searched in command line mode, completion fails horribly (sometime crashing nvim entirely) when the partial string to complete contains non-escape characters. For example, running `:Lazy up[` results in a crash. The fix is to instruct string.find to perform a literal search, treating the string to search not as a regular expression.
1 parent 6610b15 commit f125a7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/lazy/view/commands.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function M.setup()
112112

113113
---@param key string
114114
return vim.tbl_filter(function(key)
115-
return key:find(prefix) == 1
115+
return key:find(prefix, 1, true) == 1
116116
end, vim.tbl_keys(M.commands))
117117
end,
118118
})

0 commit comments

Comments
 (0)