Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lua/neorg/modules/core/tangle/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,12 @@ module.on_event = function(event)
end

vim.uv.fs_write(fd, write_content, 0, function(werr)
-- Whether or not we successfully wrote the file, close the fd.
vim.uv.fs_close(fd, function(err)
assert(not err, lib.lazy_string_concat("Failed to close file '", file, "' for tangling: ", err))
end)

-- Now that we've cleaned up the fd, we can notify of any failures.
assert(not werr, lib.lazy_string_concat("Failed to write to '", file, "' for tangling: ", werr))
tangled_count = tangled_count + 1
file_count = file_count - 1
Expand All @@ -533,9 +539,6 @@ module.on_event = function(event)
)
end
end)
vim.uv.fs_close(fd, function(err)
assert(not err, lib.lazy_string_concat("Failed to close file '", file, "' for tangling: ", err))
end)
end)
::continue::
end
Expand Down