Skip to content

Commit a77fa7b

Browse files
committed
chore: resolve deprecated in 0.11
1 parent a4386a1 commit a77fa7b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lua/nvim-tree/renderer/components/full-name.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,13 @@ local function show()
7979
---@type vim.api.keyset.extmark_details
8080
local details = extmark[4]
8181

82-
vim.api.nvim_buf_add_highlight(0, ns_id, details.hl_group, 0, col, details.end_col)
82+
if type(details) == "table" then
83+
if vim.fn.has("nvim-0.12") == 1 then
84+
vim.hl.range(0, ns_id, details.hl_group, { 0, col }, { 0, details.end_col, }, {})
85+
else
86+
vim.api.nvim_buf_add_highlight(0, ns_id, details.hl_group, 0, col, details.end_col) ---@diagnostic disable-line: deprecated
87+
end
88+
end
8389
end
8490
vim.cmd([[ setlocal nowrap cursorline noswapfile nobuflisted buftype=nofile bufhidden=wipe ]])
8591
end)

0 commit comments

Comments
 (0)