diff options
| author | Isak Samsten <isak@samsten.se> | 2023-04-17 13:53:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-17 12:53:34 +0100 |
| commit | 07b60efd8058bb515998f50048b511d50f9671f8 (patch) | |
| tree | 5a61d00334466eaaea87ce0f41b9da2a0c31ab8a /runtime/doc | |
| parent | e83682e652ff68cf9a05f0076bb088e9231d2059 (diff) | |
| download | rneovim-07b60efd8058bb515998f50048b511d50f9671f8.tar.gz rneovim-07b60efd8058bb515998f50048b511d50f9671f8.tar.bz2 rneovim-07b60efd8058bb515998f50048b511d50f9671f8.zip | |
feat(diagnostic): specify diagnostic virtual text prefix as a function
- vim.diagnostic.config() now accepts a function for the virtual_text.prefix
option, which allows for rendering e.g., diagnostic severities differently.
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* |