diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2021-11-14 18:40:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-14 18:40:11 -0700 |
commit | 3c74ba4acb87ebf7c5f2090ac9b4644cafec2495 (patch) | |
tree | ac50eb8d30290951b690d9a6e277f3c30359f2c9 /runtime/doc | |
parent | 2f37ffb71920d0b50f658108736a1465e1e5f280 (diff) | |
download | rneovim-3c74ba4acb87ebf7c5f2090ac9b4644cafec2495.tar.gz rneovim-3c74ba4acb87ebf7c5f2090ac9b4644cafec2495.tar.bz2 rneovim-3c74ba4acb87ebf7c5f2090ac9b4644cafec2495.zip |
feat(diagnostic): add 'prefix' option to open_float (#16321)
The 'prefix' option accepts a function or a string that is used to add a
prefix string to each diagnostic displayed in the floating window.
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/diagnostic.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index e2469b4f4e..d53aae510e 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -384,6 +384,17 @@ config({opts}, {namespace}) *vim.diagnostic.config()* a diagnostic as input and returns a string. The return value is the text used to display the diagnostic. + • prefix: (function or string) Prefix each + diagnostic in the floating window. If a + function, it must have the signature + (diagnostic, i, total) -> string, where + {i} is the index of the diagnostic being + evaluated and {total} is the total number + of diagnostics displayed in the window. + The returned string is prepended to each + diagnostic in the window. Otherwise, if + {prefix} is a string, it is prepended to + each diagnostic. • update_in_insert: (default false) Update diagnostics in Insert mode (if false, @@ -614,6 +625,9 @@ open_float({bufnr}, {opts}) *vim.diagnostic.open_float()* return value is the text used to display the diagnostic. Overrides the setting from |vim.diagnostic.config()|. + • prefix: (function or string) Prefix each + diagnostic in the floating window. Overrides + the setting from |vim.diagnostic.config()|. Return: ~ tuple ({float_bufnr}, {win_id}) |