From 46a58b74f49939c58931c79647d8ef24a160ac30 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Mon, 22 Feb 2021 23:31:12 +0100 Subject: feat(lsp): use vim.notify for some errors (#13992) --- runtime/lua/vim/lsp/handlers.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/lsp/handlers.lua b/runtime/lua/vim/lsp/handlers.lua index 7eac3febd9..7819bddcb9 100644 --- a/runtime/lua/vim/lsp/handlers.lua +++ b/runtime/lua/vim/lsp/handlers.lua @@ -13,7 +13,7 @@ local M = {} --- Writes to error buffer. --@param ... (table of strings) Will be concatenated before being written local function err_message(...) - api.nvim_err_writeln(table.concat(vim.tbl_flatten{...})) + vim.notify(table.concat(vim.tbl_flatten{...}), vim.log.levels.ERROR) api.nvim_command("redraw") end @@ -409,7 +409,7 @@ for k, fn in pairs(M) do }) if err then - error(tostring(err)) + return err_message(tostring(err)) end return fn(err, method, params, client_id, bufnr, config) -- cgit