Skip to content

Commit 8c0abee

Browse files
committed
fix scheduling issues
1 parent a952b25 commit 8c0abee

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

lua/neo-tree/sources/filesystem/lib/fs_scan.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,17 @@ local running_statuses = {}
2525
---@param cwd string Filters what worktrees to view. Should be an ancestor of all the items.
2626
---@param items neotree.FileItem[]
2727
local mark_gitignored = function(cwd, items)
28-
assert(not vim.in_fast_event(), "mark_gitignored cannot be called in a fast event")
28+
if vim.in_fast_event() then
29+
log.warn("mark_gitignored cannot be called in a fast event", debug.traceback())
30+
return
31+
end
2932
if not vim.tbl_isempty(running_statuses) then
3033
local all_queued_statuses_finished = vim.wait(WAIT_FOR_PENDING_STATUS_MS, function()
3134
return vim.tbl_isempty(running_statuses)
3235
end)
3336
if not all_queued_statuses_finished then
34-
log.at.debug.format(
35-
"Skipping wait for statuses since it took longer than %s ms",
37+
log.at.info.format(
38+
"(fs) Skipping wait for gitignored items, since it took longer than %s ms",
3639
WAIT_FOR_PENDING_STATUS_MS
3740
)
3841
end
@@ -733,10 +736,9 @@ M.get_dir_items_async = function(state, parent_id, recursive)
733736
end
734737
async.util.join(scan_tasks)
735738

736-
job_complete(context, true)
737-
738739
local finalize = async.wrap(function(_context, _callback)
739740
vim.schedule(function()
741+
job_complete(context, true)
740742
render_context(_context)
741743
_callback()
742744
end)

0 commit comments

Comments
 (0)