From 9d0f7a0b82b1983b44636259733d6d2c39497315 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 30 May 2026 16:15:53 +0200 Subject: implement backward compatible style handling Remove diagnostic_style_id and use vis.ui:style_push to obtain one. --- util.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'util.lua') diff --git a/util.lua b/util.lua index aed1032..c4894c8 100644 --- a/util.lua +++ b/util.lua @@ -409,4 +409,15 @@ function util.table.merge(weak, strong) return weak end +--- Wrapper to define a style in vis. +-- @param id The style id +-- @param style The style description +function util.style_define(id, style) + if vis.API and vis.API > 3215 then + return vis.ui:style_define(id, style) + else + return vis.win:style_define(id, style) + end +end + return util -- cgit v1.2.3