diff options
Diffstat (limited to 'runtime/doc')
| -rw-r--r-- | runtime/doc/diagnostic.txt | 7 | ||||
| -rw-r--r-- | runtime/doc/news.txt | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index 025a7dccfc..bfcc1c9092 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -392,8 +392,11 @@ config({opts}, {namespace}) *vim.diagnostic.config()* always show the diagnostic source. • spacing: (number) Amount of empty spaces inserted at the beginning of the virtual text. - • prefix: (string) Prepend diagnostic message with - prefix. + • 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. • suffix: (string or function) Append diagnostic message with suffix. If a function, it must have the signature (diagnostic) -> string, where {diagnostic} diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index f196c3d445..dc541fcf37 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -48,6 +48,9 @@ The following changes to existing APIs or features add new behavior. • |vim.region()| can use a string accepted by |getpos()| as position. +• vim.diagnostic.config() now accepts a function for the virtual_text.prefix + option, which allows for rendering e.g., diagnostic severities differently. + ============================================================================== REMOVED FEATURES *news-removed* |