feat(diagnostic): allow 'prefix' option to return highlight

Extend the 'prefix' option for `open_float` to also provide an optional
highlight group for the prefix string.
This commit is contained in:
Gregory Anders
2021-11-15 08:55:31 -07:00
parent 8f984dc1f2
commit cc48837622
3 changed files with 52 additions and 27 deletions

View File

@@ -1397,7 +1397,7 @@ describe('vim.diagnostic', function()
return lines
]])
eq("Error executing lua: .../diagnostic.lua:0: prefix: expected 'string' or 'function', got 42",
eq("Error executing lua: .../diagnostic.lua:0: prefix: expected 'string' or 'table' or 'function', got 42",
pcall_err(exec_lua, [[ vim.diagnostic.open_float(0, { prefix = 42 }) ]]))
end)
end)