diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index aed5f8e..ec10a8f 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -239,9 +239,40 @@ return { on_attach = function(client, bufnr) -- TODO: for some reason this stays true even after rootdir switch? if client.config.in_zk_notebook then - vim.defer_fn(function() - vim.lsp.buf_detach_client(bufnr, client.id) - end, 1000) + local default_handler = vim.diagnostic.handlers.virtual_text + vim.diagnostic.handlers.virtual_text = { + show = function(namespace, bufnrr, diagnostics, opts) + for i, diagnostic in ipairs(diagnostics) do + if + diagnostic.source + == "Marksman" -- You need to check what the correct value should be here + then + table.remove(diagnostics, i) + end + end + default_handler.show(namespace, bufnrr, diagnostics, opts) + end, + hide = function(...) + default_handler.hide(...) + end, + } + local default_handler = vim.diagnostic.handlers.signs + vim.diagnostic.handlers.signs = { + show = function(namespace, bufnrr, diagnostics, opts) + for i, diagnostic in ipairs(diagnostics) do + if + diagnostic.source + == "Marksman" -- You need to check what the correct value should be here + then + table.remove(diagnostics, i) + end + end + default_handler.show(namespace, bufnrr, diagnostics, opts) + end, + hide = function(...) + default_handler.hide(...) + end, + } end on_attach(client, bufnr) end,