aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/diagnostic.lua
diff options
context:
space:
mode:
authorGregory Anders <greg@gpanders.com>2022-01-11 16:39:15 -0700
committerGregory Anders <greg@gpanders.com>2022-01-11 16:39:15 -0700
commitfc8af96888f746aeae84660502d2f529a5c2cfc1 (patch)
tree671bd353ec28175db08bd0423f142fd2ea87237a /runtime/lua/vim/diagnostic.lua
parent70fe3ce004f1c17328257349da5528757fdcd354 (diff)
downloadrneovim-fc8af96888f746aeae84660502d2f529a5c2cfc1.tar.gz
rneovim-fc8af96888f746aeae84660502d2f529a5c2cfc1.tar.bz2
rneovim-fc8af96888f746aeae84660502d2f529a5c2cfc1.zip
fix(diagnostic): resolve nil opts tables
In functions which allow opts to be optional, ensure that the value actually resolves to a non-nil value.
Diffstat (limited to 'runtime/lua/vim/diagnostic.lua')
-rw-r--r--runtime/lua/vim/diagnostic.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua
index 417b661155..76e19b2de2 100644
--- a/runtime/lua/vim/diagnostic.lua
+++ b/runtime/lua/vim/diagnostic.lua
@@ -823,6 +823,7 @@ M.handlers.signs = {
}
bufnr = get_bufnr(bufnr)
+ opts = opts or {}
if opts.signs and opts.signs.severity then
diagnostics = filter_by_severity(opts.signs.severity, diagnostics)
@@ -890,6 +891,7 @@ M.handlers.underline = {
}
bufnr = get_bufnr(bufnr)
+ opts = opts or {}
if opts.underline and opts.underline.severity then
diagnostics = filter_by_severity(opts.underline.severity, diagnostics)
@@ -942,6 +944,7 @@ M.handlers.virtual_text = {
}
bufnr = get_bufnr(bufnr)
+ opts = opts or {}
local severity
if opts.virtual_text then