aboutsummaryrefslogtreecommitdiff
path: root/util.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util.lua')
-rw-r--r--util.lua11
1 files changed, 11 insertions, 0 deletions
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