Revert "chore: use api to check if buf is loaded"

This reverts commit db91909f5b.
fixes #1182
This commit is contained in:
kiyan 2022-04-21 21:31:35 +02:00
parent db91909f5b
commit ce463a53ae

View File

@ -208,7 +208,7 @@ local function update_draw_data(tree, depth, markers)
end
if should_hl_opened_files then
if api.nvim_buf_is_loaded(node.absolute_path) then
if vim.fn.bufloaded(node.absolute_path) > 0 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