chore: resolve deprecated in 0.11 (#3053)

* chore: resolve deprecated in 0.11

* chore: resolve deprecated in 0.11

* chore: resolve deprecated in 0.11

* chore: resolve deprecated in 0.11

* chore: resolve deprecated in 0.11

* chore: resolve deprecated in 0.11
This commit is contained in:
Alexander Courtis
2025-01-24 11:57:18 +11:00
committed by GitHub
parent fca0b67c0b
commit db7403243d
5 changed files with 51 additions and 32 deletions

View File

@@ -79,7 +79,13 @@ local function show()
---@type vim.api.keyset.extmark_details
local details = extmark[4]
vim.api.nvim_buf_add_highlight(0, ns_id, details.hl_group, 0, col, details.end_col)
if type(details) == "table" then
if vim.fn.has("nvim-0.12") == 1 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
end
end
end
vim.cmd([[ setlocal nowrap cursorline noswapfile nobuflisted buftype=nofile bufhidden=wipe ]])
end)