fix weird errors

This commit is contained in:
Christoph J. Scherr 2023-10-27 09:26:38 +02:00
parent a621cea73b
commit de17728410
3 changed files with 12 additions and 12 deletions

View File

@ -1,6 +1,6 @@
local M = {}
---@param opts? RafiConfig
---@param opts? PlexConfig
function M.setup(opts)
require('plex.config').setup(opts)
end

View File

@ -109,7 +109,6 @@ return {
if vim.diagnostic.is_disabled() or vim.bo[buffer].buftype ~= '' then
vim.diagnostic.disable(buffer)
return
end
end)

View File

@ -123,16 +123,17 @@ function M.on_attach(client, buffer)
local Keys = require('lazy.core.handler.keys')
local keymaps = M.resolve(buffer)
for _, keys in pairs(keymaps) do
if not keys.has or M.has(buffer, keys.has) then
local opts = Keys.opts(keys)
---@diagnostic disable-next-line: no-unknown
opts.has = nil
opts.silent = opts.silent ~= false
opts.buffer = buffer
vim.keymap.set(keys.mode or 'n', keys[1], keys[2], opts)
end
end
-- FIXME: This part causes weird errors and IDK what it does.
-- for _, keys in pairs(keymaps) do
-- if not keys.has or M.has(buffer, keys.has) then
-- local opts = Keys.opts(keys)
-- ---@diagnostic disable-next-line: no-unknown
-- opts.has = nil
-- opts.silent = opts.silent ~= false
-- opts.buffer = buffer
-- vim.keymap.set(keys.mode or 'n', keys[1], keys[2], opts)
-- end
-- end
end
-- Toggle diagnostics locally (false) or globally (true).