Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions lua/lsp-toggle/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand All @@ -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

Expand Down