diff --git a/lua/lsp-toggle/config.lua b/lua/lsp-toggle/config.lua index 04967fe..6e02544 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, } @@ -44,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