From 05d3cb476808ddfe6a5df3f6c55f878be78137e0 Mon Sep 17 00:00:00 2001 From: Guennadi Maximov C Date: Sat, 4 Oct 2025 12:26:50 -0600 Subject: [PATCH 1/2] docs(config): improved descriptions of defaults Signed-off-by: Guennadi Maximov C --- lua/lsp-toggle/config.lua | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lua/lsp-toggle/config.lua b/lua/lsp-toggle/config.lua index 04967fe..f4d3245 100644 --- a/lua/lsp-toggle/config.lua +++ b/lua/lsp-toggle/config.lua @@ -19,19 +19,26 @@ local defaults = { border = { '╔', '-', '╗', '║', '╝', '═', '╚', '║' }, -- Enable/Disable caching + -- + -- Enabled by default ---@type boolean cache = true, -- File type caching or file name caching -- Uses the file type instead of file name width caches. - -- e.g. - -- all typescript files (File type) - -- specific files (File name) - ---@type string|"file_type"|"file_name" + -- + -- For example: + -- - all typescript files `'file_type'` + -- - specific files `'file_name'` + -- + -- Set to `'file_type'` by default + ---@type 'file_type'|'file_name' cache_type = 'file_type', --- Load LSPs by default regardless of cache --- if enabled, no LSPs will be loaded by default + --- + --- This is disabled by default ---@type boolean exclusive_mode = false, } From 0700235f579401a194af720459973b6e7da330bf Mon Sep 17 00:00:00 2001 From: Guennadi Maximov C Date: Sat, 4 Oct 2025 12:28:03 -0600 Subject: [PATCH 2/2] chore(config): made conditionals consistent Signed-off-by: Guennadi Maximov C --- lua/lsp-toggle/config.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lua/lsp-toggle/config.lua b/lua/lsp-toggle/config.lua index f4d3245..6e02544 100644 --- a/lua/lsp-toggle/config.lua +++ b/lua/lsp-toggle/config.lua @@ -51,15 +51,13 @@ M.options = {} ---@param opts? LspToggle.Opts function M.setup(opts) - opts = opts or {} + M.options = vim.tbl_deep_extend('keep', opts or {}, defaults) - M.options = vim.tbl_deep_extend('keep', opts, defaults) - - if M.options.max_height <= 0 then + if M.options.max_height < 1 then M.options.max_height = defaults.max_height end - if M.options.max_width <= 0 then + if M.options.max_width < 1 then M.options.max_width = defaults.max_width end