From 025520d083c61baa7cd1f45807f5fe1ac9fbb50d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 18 Jun 2024 00:35:56 +0200 Subject: [PATCH] fix(util): dump --- lua/lazy/util.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/lazy/util.lua b/lua/lazy/util.lua index 705ca39..970b066 100644 --- a/lua/lazy/util.lua +++ b/lua/lazy/util.lua @@ -237,6 +237,8 @@ function M._dump(value, result) table.insert(result, tostring(value)) elseif t == "string" then table.insert(result, ("%q"):format(value)) + elseif t == "table" and value._raw then + table.insert(result, value._raw) elseif t == "table" then table.insert(result, "{") local i = 1 @@ -244,7 +246,11 @@ function M._dump(value, result) for k, v in pairs(value) do if k == i then elseif type(k) == "string" then - table.insert(result, ("[%q]="):format(k)) + if k:match("^[a-zA-Z]+$") then + table.insert(result, ("%s="):format(k)) + else + table.insert(result, ("[%q]="):format(k)) + end else table.insert(result, k .. "=") end