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

@@ -55,7 +55,7 @@ function HighlightDisplay:render(bufnr, fmt, l)
vim.api.nvim_buf_set_lines(bufnr, l, -1, true, { text })
if vim.fn.has("nvim-0.11") == 1 then
if vim.fn.has("nvim-0.11") == 1 and vim.hl and vim.hl.range then
vim.hl.range(bufnr, namespace_hi_test_id, self.group, { l, 0 }, { l, #self.group, }, {})
else
vim.api.nvim_buf_add_highlight(bufnr, -1, self.group, l, 0, #self.group) ---@diagnostic disable-line: deprecated