Skip to content

Commit

Permalink
fix: add support for Neovim v0.7+
Browse files Browse the repository at this point in the history
Co-authored-by: Lukas Reineke <[email protected]>
  • Loading branch information
mehalter and lukas-reineke committed Oct 2, 2023
1 parent 2ec42d2 commit 0f9eaa7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lua/ibl/highlights.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ 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
---@diagnostic disable-next-line
hl = vim.api.nvim_get_hl_by_name(name, true)
end
return hl
end

local not_set = function(hl)
Expand Down

0 comments on commit 0f9eaa7

Please sign in to comment.