Skip to content

Commit

Permalink
fix: add support for Neovim v0.7+
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Oct 1, 2023
1 parent 2ec42d2 commit 3ebc5ac
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lua/ibl/highlights.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3ebc5ac

Please sign in to comment.