+11
-4
lines changedFilter options
+11
-4
lines changed Original file line number Diff line number Diff line change
@@ -334,8 +334,9 @@ config({opts}, {namespace}) *vim.diagnostic.config()*
334
334
that returns any of the above.
335
335
336
336
Parameters: ~
337
-
{opts} table Configuration table with the following
338
-
keys:
337
+
{opts} table|nil When omitted or "nil", retrieve the
338
+
current configuration. Otherwise, a
339
+
configuration table with the following keys:
339
340
• underline: (default true) Use underline for
340
341
diagnostics. Options:
341
342
• severity: Only underline diagnostics
Original file line number Diff line number Diff line change
@@ -552,7 +552,8 @@ end
552
552
--- - `table`: Enable this feature with overrides. Use an empty table to use default values.
553
553
--- - `function`: Function with signature (namespace, bufnr) that returns any of the above.
554
554
---
555
-
---@param opts table Configuration table with the following keys:
555
+
---@param opts table|nil When omitted or "nil", retrieve the current configuration. Otherwise, a
556
+
--- configuration table with the following keys:
556
557
--- - underline: (default true) Use underline for diagnostics. Options:
557
558
--- * severity: Only underline diagnostics matching the given severity
558
559
--- |diagnostic-severity|
@@ -599,7 +600,7 @@ end
599
600
--- global diagnostic options.
600
601
function M.config(opts, namespace)
601
602
vim.validate {
602
-
opts = { opts, 't' },
603
+
opts = { opts, 't', true },
603
604
namespace = { namespace, 'n', true },
604
605
}
605
606
@@ -611,6 +612,11 @@ function M.config(opts, namespace)
611
612
t = global_diagnostic_options
612
613
end
613
614
615
+
if not opts then
616
+
-- Return current config
617
+
return vim.deepcopy(t)
618
+
end
619
+
614
620
for k, v in pairs(opts) do
615
621
t[k] = v
616
622
end
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4