diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2021-11-16 08:48:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-16 08:48:26 -0700 |
commit | 8fb09bc5129db9d9b2f650ab30f35f55593937f3 (patch) | |
tree | fb9bd011c67ec15d2c05d0f19eb594d04886c12d /runtime/doc | |
parent | 98af683e0fb129520a9c0cb29f324743e0e2083f (diff) | |
parent | 63413bd0478ebbb2aa5fc90b2533a04d8b785bbc (diff) | |
download | rneovim-8fb09bc5129db9d9b2f650ab30f35f55593937f3.tar.gz rneovim-8fb09bc5129db9d9b2f650ab30f35f55593937f3.tar.bz2 rneovim-8fb09bc5129db9d9b2f650ab30f35f55593937f3.zip |
Merge pull request #16328 from gpanders/diagnostic-prefix-hi
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/diagnostic.txt | 49 |
1 files changed, 31 insertions, 18 deletions
diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index dc00d47193..1dd9c4f301 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -375,8 +375,11 @@ config({opts}, {namespace}) *vim.diagnostic.config()* • float: Options for floating windows: • severity: See |diagnostic-severity|. - • show_header: (boolean, default true) Show - "Diagnostics:" header + • header: (string or table) String to use + as the header for the floating window. If + a table, it is interpreted as a [text, + hl_group] tuple. Defaults to + "Diagnostics:". • source: (string) Include the diagnostic source in the message. One of "always" or "if_many". @@ -384,17 +387,24 @@ 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: (function, string, or table) + Prefix each diagnostic in the floating + window. If a function, it must have the + signature (diagnostic, i, total) -> + (string, string), where {i} is the index + of the diagnostic being evaluated and + {total} is the total number of + diagnostics displayed in the window. The + function should return a string which is + prepended to each diagnostic in the + window as well as an (optional) highlight + group which will be used to highlight the + prefix. If {prefix} is a table, it is + interpreted as a [text, hl_group] tuple + as in |nvim_echo()|; otherwise, if {prefix} is a string, it is prepended to - each diagnostic. + each diagnostic in the window with no + highlight. • update_in_insert: (default false) Update diagnostics in Insert mode (if false, @@ -616,9 +626,11 @@ open_float({bufnr}, {opts}) *vim.diagnostic.open_float()* |vim.diagnostic.config()|. • severity: See |diagnostic-severity|. Overrides the setting from |vim.diagnostic.config()|. - • show_header: (boolean, default true) Show - "Diagnostics:" header. Overrides the setting - from |vim.diagnostic.config()|. + • header: (string or table) String to use as the + header for the floating window. If a table, it + 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 @@ -628,9 +640,10 @@ 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()|. + • prefix: (function, string, or table) Prefix + each diagnostic in the floating window. + Overrides the setting from + |vim.diagnostic.config()|. Return: ~ tuple ({float_bufnr}, {win_id}) |