fix(#3059): test for presence of new 0.11 API vim.hl.range (#3060)

This commit is contained in:
Alexander Courtis
2025-02-03 15:42:22 +11:00
committed by GitHub
parent d05881f65f
commit 70825f23db
4 changed files with 4 additions and 4 deletions

View File

@@ -80,7 +80,7 @@ local function show()
local details = extmark[4]
if type(details) == "table" then
if vim.fn.has("nvim-0.12") == 1 then
if vim.fn.has("nvim-0.11") == 1 and vim.hl and vim.hl.range then
vim.hl.range(0, ns_id, details.hl_group, { 0, col }, { 0, details.end_col, }, {})
else
vim.api.nvim_buf_add_highlight(0, ns_id, details.hl_group, 0, col, details.end_col) ---@diagnostic disable-line: deprecated