From fc8af96888f746aeae84660502d2f529a5c2cfc1 Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Tue, 11 Jan 2022 16:39:15 -0700 Subject: 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. --- runtime/lua/vim/diagnostic.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/lua/vim') 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 -- cgit