diff options
-rw-r--r-- | runtime/lua/vim/lsp/diagnostic.lua | 4 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/util.lua | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua index 03d7121caa..66a7e39749 100644 --- a/runtime/lua/vim/lsp/diagnostic.lua +++ b/runtime/lua/vim/lsp/diagnostic.lua @@ -1219,13 +1219,11 @@ function M.set_loclist(opts) local row = pos.line local col = util.character_offset(bufnr, row, pos.character) - local line = (api.nvim_buf_get_lines(bufnr, row, row + 1, false) or {""})[1] - table.insert(items, { bufnr = bufnr, lnum = row + 1, col = col + 1, - text = line .. " | " .. diag.message, + text = diag.message, type = loclist_type_map[diag.severity or DiagnosticSeverity.Error] or 'E', }) end diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index d442f9424c..9862b1dd32 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -40,9 +40,12 @@ local function get_border_size(opts) local width = 0 if type(border) == 'string' then - -- 'single', 'double', etc. - height = 2 - width = 2 + local border_size = {none = {0, 0}, single = {2, 2}, double = {2, 2}, shadow = {1, 1}} + if border_size[border] == nil then + error("floating preview border is not correct. Please refer to the docs |vim.api.nvim_open_win()|" + .. vim.inspect(border)) + end + height, width = unpack(border_size[border]) else local function border_width(id) if type(border[id]) == "table" then |