From 1bd81b2e905ab2733de4ad25b790842db6743a67 Mon Sep 17 00:00:00 2001 From: MisanthropicBit Date: Thu, 28 Nov 2024 10:24:46 +0100 Subject: [PATCH] Handle setting highlight on v0.9.0 --- lua/winmove/highlight.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/winmove/highlight.lua b/lua/winmove/highlight.lua index d57925e..1925e61 100644 --- a/lua/winmove/highlight.lua +++ b/lua/winmove/highlight.lua @@ -78,7 +78,8 @@ local function generate_highlights(mode, groups) -- Create a new highlight group we can link to hl_group = ("Winmove%sInternal%s"):format(titlecase_mode, hl_group) - if vim.fn.hlexists(hl_group) == 0 then + -- nvim_get_hl creates the highlight group if it does not exist on <= v0.9.0 + if not compat.has("nvim-0.10.0") or vim.fn.hlexists(hl_group) == 0 then vim.api.nvim_set_hl(global_ns_id, hl_group, colors) end end