fix(mini.surround): don't create empty keymaps. Fixes #296

This commit is contained in:
Folke Lemaitre
2023-02-18 09:55:56 +01:00
parent a0cf00c81b
commit 8e84dcf85c

View File

@ -107,6 +107,9 @@ return {
{ opts.mappings.replace, desc = "Replace surrounding" },
{ opts.mappings.update_n_lines, desc = "Update `MiniSurround.config.n_lines`" },
}
mappings = vim.tbl_filter(function(m)
return m[1] and #m[1] > 0
end, mappings)
return vim.list_extend(mappings, keys)
end,
opts = {