feat(git): support DA state, fix(#1822): test directory capable of watching before presenting it (#1905)

* fix(#1822): test directory capable of watching before presenting it (#1901)

* feat(git): support `DA` state

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
gegoune
2023-01-10 03:32:53 +01:00
committed by GitHub
parent ccb6d8a518
commit 3ce0a8e770
4 changed files with 35 additions and 2 deletions

View File

@@ -6,6 +6,8 @@ local filters = require "nvim-tree.explorer.filters"
local live_filter = require "nvim-tree.live-filter"
local log = require "nvim-tree.log"
local Watcher = require "nvim-tree.watcher"
local M = {}
local function get_type_from(type_, cwd)
@@ -28,7 +30,11 @@ local function populate_children(handle, cwd, node, git_status)
local ps = log.profile_start(pn)
t = get_type_from(t, abs)
if not filters.should_filter(abs, filter_status) and not nodes_by_path[abs] then
if
not filters.should_filter(abs, filter_status)
and not nodes_by_path[abs]
and Watcher.is_fs_event_capable(abs)
then
local child = nil
if t == "directory" and vim.loop.fs_access(abs, "R") then
child = builders.folder(node, abs, name)