fix ripgrep drain out memory

Signed-off-by: Lee Tang <i@d0zingcat.dev>
This commit is contained in:
Lee Tang
2023-05-11 12:42:48 +08:00
parent 0442553c33
commit ccd57f9718
3 changed files with 21 additions and 6 deletions

View File

@@ -34,7 +34,11 @@ local function map(modes, lhs, rhs, opts)
modes = { modes }
end
for _, mode in ipairs(modes) do
map_key(mode, lhs, rhs, opts)
if type(rhs) == "string" then
map_key(mode, lhs, rhs, opts)
else
vim.keymap.set(mode, lhs, rhs, opts)
end
end
end