From 3ebc5ac74cc413f2def9bfc1aeb68f71efccf50e Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Fri, 29 Sep 2023 18:05:47 -0400 Subject: [PATCH] fix: add support for Neovim v0.7+ --- lua/ibl/highlights.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/ibl/highlights.lua b/lua/ibl/highlights.lua index d14a0b64..e883bde7 100644 --- a/lua/ibl/highlights.lua +++ b/lua/ibl/highlights.lua @@ -15,7 +15,13 @@ local M = { } local get = function(name) - return vim.api.nvim_get_hl(0, { name = name }) + local hl + if vim.api.nvim_get_hl then -- check for new neovim 0.9 API + hl = vim.api.nvim_get_hl(0, { name = name }) + else + hl = vim.api.nvim_get_hl_by_name(name, vim.o.termguicolors) + end + return hl end local not_set = function(hl)