aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2021-12-17 19:38:33 -0700
committerGitHub <noreply@github.com>2021-12-17 19:38:33 -0700
commit818ae74eaf6f4538ca61ee4ba703543b0caaff10 (patch)
tree1a6397857c66302d91eb21b2aaf8878c19a21df5 /runtime/doc
parent36c401db243da08a60bde7f2c42e1ed9f5204c85 (diff)
downloadrneovim-818ae74eaf6f4538ca61ee4ba703543b0caaff10.tar.gz
rneovim-818ae74eaf6f4538ca61ee4ba703543b0caaff10.tar.bz2
rneovim-818ae74eaf6f4538ca61ee4ba703543b0caaff10.zip
fix(diagnostic): respect "if_many" source option for virtual text (#16653)
The `prefix_source` function only evaluates the sources from the diagnostics passed to it; however, because each namespace draws its own virtual text, its diagnostics will never contain more than a single source (by definition). This requires changing the semantics of what "if_many" means from "multiple sources in a single 'batch' of diagnostics" to "multiple sources of all diagnostics within a buffer".
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/diagnostic.txt18
1 files changed, 12 insertions, 6 deletions
diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt
index 0893f1f343..a825435179 100644
--- a/runtime/doc/diagnostic.txt
+++ b/runtime/doc/diagnostic.txt
@@ -347,9 +347,12 @@ config({opts}, {namespace}) *vim.diagnostic.config()*
• severity: Only show virtual text for
diagnostics matching the given severity
|diagnostic-severity|
- • source: (string) Include the diagnostic
- source in virtual text. One of "always"
- or "if_many".
+ • source: (boolean or string) Include the
+ diagnostic source in virtual text. Use
+ "if_many" to only show sources if there
+ is more than one diagnostic source in the
+ buffer. Otherwise, any truthy value means
+ to always show the diagnostic source.
• format: (function) A function that takes
a diagnostic as input and returns a
string. The return value is the text used
@@ -608,9 +611,12 @@ open_float({opts}, {...}) *vim.diagnostic.open_float()*
is interpreted as a [text, hl_group] tuple.
Overrides the setting from
|vim.diagnostic.config()|.
- • source: (string) Include the diagnostic source
- in the message. One of "always" or "if_many".
- Overrides the setting from
+ • source: (boolean or string) Include the
+ diagnostic source in the message. Use "if_many"
+ to only show sources if there is more than one
+ source of diagnostics in the buffer. Otherwise,
+ any truthy value means to always show the
+ diagnostic source. Overrides the setting from
|vim.diagnostic.config()|.
• format: (function) A function that takes a
diagnostic as input and returns a string. The