aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/lua/vim/lsp/diagnostic.lua8
-rw-r--r--runtime/lua/vim/lsp/util.lua2
2 files changed, 5 insertions, 5 deletions
diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua
index 05b68472e7..c6fed54908 100644
--- a/runtime/lua/vim/lsp/diagnostic.lua
+++ b/runtime/lua/vim/lsp/diagnostic.lua
@@ -271,12 +271,12 @@ local function set_diagnostic_cache(diagnostics, bufnr, client_id)
end
-- Account for servers that place diagnostics on terminating newline
if buf_line_count > 0 then
- diagnostic.range.start.line = math.min(
+ diagnostic.range.start.line = math.max(math.min(
diagnostic.range.start.line, buf_line_count - 1
- )
- diagnostic.range["end"].line = math.min(
+ ), 0)
+ diagnostic.range["end"].line = math.max(math.min(
diagnostic.range["end"].line, buf_line_count - 1
- )
+ ), 0)
end
end
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index 2ea848dfe9..afe1ead9ee 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -50,7 +50,7 @@ local function get_border_size(opts)
local width = 0
if type(border) == 'string' then
- local border_size = {none = {0, 0}, single = {2, 2}, double = {2, 2}, shadow = {1, 1}}
+ local border_size = {none = {0, 0}, single = {2, 2}, double = {2, 2}, rounded = {2, 2}, solid = {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))