fix: ensure quote_chars is never nil to prevent ipairs error

This commit is contained in:
Jan K9f 2025-07-28 20:43:11 +02:00
commit c5774ddbde
Signed by: jank
GPG key ID: 22BEAC760B3333D6

View file

@ -99,6 +99,11 @@ end
function M.setup(user_options)
user_options = user_options or {}
M.options = vim.tbl_deep_extend("force", vim.deepcopy(defaults), user_options)
-- Ensure quote_chars is never nil
if not M.options.quote_chars or #M.options.quote_chars == 0 then
M.options.quote_chars = vim.deepcopy(defaults.quote_chars)
end
local map_opts = {
desc = "JQuote: Swap quote characters",