docs: working example for vim.diagnostics.config.signs

Fixes #863
This commit is contained in:
Laszlo Bacsi 2025-07-04 22:38:25 +02:00
commit 6ec28999cb
No known key found for this signature in database
GPG key ID: 7AC6E86EE9E48853

View file

@ -57,14 +57,21 @@
signs = mkOption {
type = diagnosticType;
default = false;
example = {
signs.text = {
"vim.diagnostic.severity.ERROR" = "󰅚 ";
"vim.diagnostic.severity.WARN" = "󰀪 ";
};
};
example = literalExpression ''
signs.text = lib.generators.mkLuaInline '''
{
[vim.diagnostic.severity.ERROR] = "󰅚 ",
[vim.diagnostic.severity.WARN] = "󰀪 ",
}
''';
'';
description = ''
Use signs for diagnostics. See {command}`:help diagnostic-signs`.
:::{.note}
The code presented in that help section uses lua expressions as object keys which
only translate well if you use `lib.generators.mkLuaInline` as in the example.
:::
'';
};