Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lua/neorg/core/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
--- Gets the current operating system.
--- @return OperatingSystem
local function get_os_info()
local os = vim.loop.os_uname().sysname:lower()
local os = vim.uv.os_uname().sysname:lower()

if os:find("windows_nt") or os:find("mingw32_nt") then
return "windows"
Expand Down
2 changes: 1 addition & 1 deletion lua/neorg/modules/core/dirman/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ module.public = {
-- Create or overwrite the file
local fd = destination:fs_open(opts.force and "w" or "a", Path.const.o644, false)
if fd then
vim.loop.fs_close(fd)
vim.uv.fs_close(fd)
end

-- Broadcast file creation event
Expand Down
12 changes: 6 additions & 6 deletions lua/neorg/modules/core/export/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,11 @@ module.on_event = function(event)
local filetype = event.content[2] or vim.filetype.match({ filename = filepath })
local exported = module.public.export(event.buffer, filetype)

vim.loop.fs_open(filepath, "w", 438, function(err, fd)
vim.uv.fs_open(filepath, "w", 438, function(err, fd)
assert(not err, lib.lazy_string_concat("Failed to open file '", filepath, "' for export: ", err))
assert(fd)

vim.loop.fs_write(fd, exported, 0, function(werr)
vim.uv.fs_write(fd, exported, 0, function(werr)
assert(not werr, lib.lazy_string_concat("Failed to write to file '", filepath, "' for export: ", werr))
end)

Expand Down Expand Up @@ -316,14 +316,14 @@ module.on_event = function(event)
---@diagnostic disable-next-line: undefined-field
local old_event_ignore = table.concat(vim.opt.eventignore:get(), ",")

vim.loop.fs_scandir(event.content[1], function(err, handle)
vim.uv.fs_scandir(event.content[1], function(err, handle)
assert(not err, lib.lazy_string_concat("Failed to scan directory '", event.content[1], "': ", err))
assert(handle)

local file_counter, parsed_counter = 0, 0

while true do
local name, type = vim.loop.fs_scandir_next(handle)
local name, type = vim.uv.fs_scandir_next(handle)

if not name then
break
Expand Down Expand Up @@ -363,14 +363,14 @@ module.on_event = function(event)

local write_path = path .. "/" .. name:gsub("%.%a+$", "." .. extension)

vim.loop.fs_open(write_path, "w+", 438, function(fs_err, fd)
vim.uv.fs_open(write_path, "w+", 438, function(fs_err, fd)
assert(
not fs_err,
lib.lazy_string_concat("Failed to open file '", write_path, "' for export: ", fs_err)
)
assert(fd)

vim.loop.fs_write(fd, exported, 0, function(werr)
vim.uv.fs_write(fd, exported, 0, function(werr)
assert(
not werr,
lib.lazy_string_concat(
Expand Down
4 changes: 2 additions & 2 deletions lua/neorg/modules/core/fs/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.public = {
---@return boolean #If true, the directory copying succeeded
copy_directory = function(old_path, new_path)
local file_permissions = tonumber("744", 8)
local ok, err = vim.loop.fs_mkdir(new_path, file_permissions)
local ok, err = vim.uv.fs_mkdir(new_path, file_permissions)

if not ok then
return ok, err ---@diagnostic disable-line -- TODO: type error workaround <pysan3>
Expand All @@ -41,7 +41,7 @@ module.public = {
for name, type in vim.fs.dir(old_path) do
if type == "file" then
ok, err =
vim.loop.fs_copyfile(table.concat({ old_path, "/", name }), table.concat({ new_path, "/", name }))
vim.uv.fs_copyfile(table.concat({ old_path, "/", name }), table.concat({ new_path, "/", name }))

if not ok then
return ok, err ---@diagnostic disable-line -- TODO: type error workaround <pysan3>
Expand Down
11 changes: 5 additions & 6 deletions lua/neorg/modules/core/journal/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,7 @@ module.public = {
-- path is for each subfolder
local get_fs_handle = function(path)
path = path or ""
local handle =
vim.loop.fs_scandir(workspace_path .. config.pathsep .. folder_name .. config.pathsep .. path)
local handle = vim.uv.fs_scandir(workspace_path .. config.pathsep .. folder_name .. config.pathsep .. path)

if type(handle) ~= "userdata" then
error(lib.lazy_string_concat("Failed to scan directory '", workspace, path, "': ", handle))
Expand All @@ -302,12 +301,12 @@ module.public = {
end
end

vim.loop.fs_scandir(workspace_path .. config.pathsep .. folder_name .. config.pathsep, function(err, handle)
vim.uv.fs_scandir(workspace_path .. config.pathsep .. folder_name .. config.pathsep, function(err, handle)
assert(not err, lib.lazy_string_concat("Unable to generate TOC for directory '", folder_name, "' - ", err))

while true do
-- Name corresponds to either a YYYY-mm-dd.norg file, or just the year ("nested" strategy)
local name, type = vim.loop.fs_scandir_next(handle) ---@diagnostic disable-line -- TODO: type error workaround <pysan3>
local name, type = vim.uv.fs_scandir_next(handle) ---@diagnostic disable-line -- TODO: type error workaround <pysan3>

if not name then
break
Expand All @@ -318,7 +317,7 @@ module.public = {
local years_handle = get_fs_handle(name)
while true do
-- mname is the month
local mname, mtype = vim.loop.fs_scandir_next(years_handle)
local mname, mtype = vim.uv.fs_scandir_next(years_handle)

if not mname then
break
Expand All @@ -328,7 +327,7 @@ module.public = {
local months_handle = get_fs_handle(name .. config.pathsep .. mname)
while true do
-- dname is the day
local dname, dtype = vim.loop.fs_scandir_next(months_handle)
local dname, dtype = vim.uv.fs_scandir_next(months_handle)

if not dname then
break
Expand Down
2 changes: 1 addition & 1 deletion lua/neorg/modules/core/syntax/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ module.on_event = function(event)

local block_bottom, block_top = block_current - 1, block_current + 1

local timer = vim.loop.new_timer()
local timer = vim.uv.new_timer()

timer:start(
module.config.public.performance.timeout,
Expand Down
Loading