From c45541ec7761b4b10ae1702f68c63b610aea868c Mon Sep 17 00:00:00 2001 From: aileot <46470475+aileot@users.noreply.github.com> Date: Tue, 17 Jun 2025 23:08:14 +0900 Subject: [PATCH] refactor(config): dump default values in error --- fnl/thyme/config/init.fnl | 3 ++- lua/thyme/config/init.lua | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fnl/thyme/config/init.fnl b/fnl/thyme/config/init.fnl index e76aaf94..e2886672 100644 --- a/fnl/thyme/config/init.fnl +++ b/fnl/thyme/config/init.fnl @@ -150,7 +150,8 @@ To stop the forced rollback after repair, please run `:ThymeRollbackUnmount` or ;; NOTE: Do NOT overwrite self with `rawset` to keep ;; __newindex working. (case (. default-opts k) - nil (error (.. "unexpected option detected: " k)) + nil (error (-> "unexpected option detected: %s\ndefault-values:\n%s" + (: :format k (vim.inspect default-opts)))) _ (. config k))))) :__newindex (when-not debug? (fn [_ key] diff --git a/lua/thyme/config/init.lua b/lua/thyme/config/init.lua index 7b66e94b..7e4dca77 100644 --- a/lua/thyme/config/init.lua +++ b/lua/thyme/config/init.lua @@ -121,7 +121,7 @@ local function _15_(_self, k) local config = get_config() local _17_ = default_opts[k] if (_17_ == nil) then - return error(("unexpected option detected: " .. k)) + return error(("unexpected option detected: %s\ndefault-values:\n%s"):format(k, vim.inspect(default_opts))) else local _0 = _17_ return config[k]