Adds a provider for diagnostics. Mostly taken from vim.diagnostic.show_float, with some tweaks.
Options from vim.diagnostic.config are used for float opts like scope and severity_sort.
This required a change to open_floating_preview to work - previously if a provider returned a bufnr only, open_floating_preview would read in all the lines from the buffer and then set them again using nvim_buf_set_lines. This is both unnecessary and causes problems, such as breaking applied highlights in the case of diagnostics. open_floating_preview will now only set the buffer's lines if they are explicitly provided through the contents parameter.
Adds a provider for diagnostics. Mostly taken from
vim.diagnostic.show_float
, with some tweaks.Options from
vim.diagnostic.config
are used for float opts likescope
andseverity_sort
.This required a change to
open_floating_preview
to work - previously if a provider returned a bufnr only,open_floating_preview
would read in all the lines from the buffer and then set them again usingnvim_buf_set_lines
. This is both unnecessary and causes problems, such as breaking applied highlights in the case of diagnostics.open_floating_preview
will now only set the buffer's lines if they are explicitly provided through thecontents
parameter.Resolves #34