chore: use api to check if buf is loaded

This commit is contained in:
kiyan 2022-04-21 20:46:24 +02:00
parent 95a5c2d4bc
commit db91909f5b

View File

@ -208,7 +208,7 @@ local function update_draw_data(tree, depth, markers)
end
if should_hl_opened_files then
if vim.fn.bufloaded(node.absolute_path) > 0 then
if api.nvim_buf_is_loaded(node.absolute_path) then
if vim.g.nvim_tree_highlight_opened_files == 1 then
table.insert(hl, { "NvimTreeOpenedFile", index, offset, offset + #icon }) -- highlight icon only
elseif vim.g.nvim_tree_highlight_opened_files == 2 then