aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorJongwook Choi <wookayin@gmail.com>2023-10-27 09:17:46 -0400
committerGitHub <noreply@github.com>2023-10-27 08:17:46 -0500
commitadd1b10b79011d1af61419a63cc8ef4645f45bbf (patch)
tree44e20b13124d859a90fc155592f3282c34722012 /runtime/doc
parent4fcdfa5ad01fd8f7e8c0e044fcf004692c0889d5 (diff)
downloadrneovim-add1b10b79011d1af61419a63cc8ef4645f45bbf.tar.gz
rneovim-add1b10b79011d1af61419a63cc8ef4645f45bbf.tar.bz2
rneovim-add1b10b79011d1af61419a63cc8ef4645f45bbf.zip
fix(diagnostic): virtual_text prefix function should have index and total (#25801)
The prefix option of the diagnostic virtual text can be a function, but previously it was only a function of diagnostic. This function should also have additional parameters index and total, more consistently and similarily as in the prefix function for `vim.diagnostic.open_float()`. These additional parameters will be useful when there are too many number of diagnostics in a single line.
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/diagnostic.txt9
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt
index e9ca9ee347..7f5c809ac3 100644
--- a/runtime/doc/diagnostic.txt
+++ b/runtime/doc/diagnostic.txt
@@ -404,9 +404,12 @@ config({opts}, {namespace}) *vim.diagnostic.config()*
the beginning of the virtual text.
• prefix: (string or function) prepend diagnostic
message with prefix. If a function, it must have the
- signature (diagnostic) -> string, where {diagnostic}
- is of type |diagnostic-structure|. This can be used
- to render diagnostic symbols or error codes.
+ signature (diagnostic, i, total) -> string, where
+ {diagnostic} is of type |diagnostic-structure|, {i}
+ is the index of the diagnostic being evaluated, and
+ {total} is the total number of diagnostics for the
+ line. This can be used to render diagnostic symbols
+ or error codes.
• suffix: (string or function) Append diagnostic
message with suffix. If a function, it must have the
signature (diagnostic) -> string, where {diagnostic}