From c5774ddbde3715b19e189bc1be3c82f1c5e47dc4 Mon Sep 17 00:00:00 2001 From: jank Date: Mon, 28 Jul 2025 20:43:11 +0200 Subject: [PATCH] fix: ensure quote_chars is never nil to prevent ipairs error --- lua/jquote/init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/jquote/init.lua b/lua/jquote/init.lua index 106c9c0..50f8cfa 100644 --- a/lua/jquote/init.lua +++ b/lua/jquote/init.lua @@ -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",