aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index 63610c7..33a2ca6 100644
--- a/init.lua
+++ b/init.lua
@@ -593,7 +593,14 @@ end
local function lspc_highlight_server_diagnostics(win, server_diagnostics, style)
if not style then
- style = lspc.diagnostic_style_id or win.STYLE_LEXER_MAX
+ if not lspc.diagnostic_style_id then
+ if vis.API and vis.API > 3215 then
+ lspc.diagnostic_style_id = vis.ui:style_push()
+ else
+ lspc.diagnostic_style_id = win.STYLE_LEXER_MAX
+ end
+ end
+ style = lspc.diagnostic_style_id
end
local level_mapping = {
@@ -605,7 +612,7 @@ local function lspc_highlight_server_diagnostics(win, server_diagnostics, style)
for _, diagnostic in ipairs(server_diagnostics) do
local diagnostic_style = level_mapping[diagnostic.severity] or level_mapping[1]
- assert(win:style_define(style, diagnostic_style))
+ assert(util.style_define(style, diagnostic_style))
if lspc.highlight_diagnostics == 'range' then
local range = diagnostic.vis_range