Skip to content

Commit b48f92b

Browse files
committed
fix: fix case where handler is false
1 parent 5104b51 commit b48f92b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lua/astrolsp/init.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ end
6868
function M.lsp_setup(server)
6969
local opts, default_handler
7070
if M.config.native_lsp_config then
71-
opts = M.lsp_config(server)
71+
opts = M.lsp_opts(server)
7272
default_handler = function(server_name) vim.lsp.enable(server_name) end
7373
else
7474
-- if server doesn't exist, set it up from user server definition
@@ -91,9 +91,8 @@ function M.lsp_setup(server)
9191
end
9292
end
9393
end
94-
local handler = M.config.handlers[server]
95-
if handler == nil then handler = M.config.handlers[1] end
96-
(handler or default_handler)(server, opts)
94+
local handler = vim.F.if_nil(M.config.handlers[server], M.config.handlers[1], default_handler)
95+
if handler then handler(server, opts) end
9796
end
9897

9998
--- The `on_attach` function used by AstroNvim

0 commit comments

Comments
 (0)