diff --git a/lua/neorg/core/config.lua b/lua/neorg/core/config.lua index 7c63a0ddf..229f19643 100644 --- a/lua/neorg/core/config.lua +++ b/lua/neorg/core/config.lua @@ -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" diff --git a/lua/neorg/modules/core/dirman/module.lua b/lua/neorg/modules/core/dirman/module.lua index 1a57738c4..ff769b834 100644 --- a/lua/neorg/modules/core/dirman/module.lua +++ b/lua/neorg/modules/core/dirman/module.lua @@ -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 diff --git a/lua/neorg/modules/core/export/module.lua b/lua/neorg/modules/core/export/module.lua index 41871be74..92a8a70e9 100644 --- a/lua/neorg/modules/core/export/module.lua +++ b/lua/neorg/modules/core/export/module.lua @@ -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) @@ -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 @@ -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( diff --git a/lua/neorg/modules/core/fs/module.lua b/lua/neorg/modules/core/fs/module.lua index 591110b09..3b0d64fa7 100644 --- a/lua/neorg/modules/core/fs/module.lua +++ b/lua/neorg/modules/core/fs/module.lua @@ -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 @@ -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 diff --git a/lua/neorg/modules/core/journal/module.lua b/lua/neorg/modules/core/journal/module.lua index 4f151fe85..40989239c 100644 --- a/lua/neorg/modules/core/journal/module.lua +++ b/lua/neorg/modules/core/journal/module.lua @@ -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)) @@ -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 + local name, type = vim.uv.fs_scandir_next(handle) ---@diagnostic disable-line -- TODO: type error workaround if not name then break @@ -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 @@ -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 diff --git a/lua/neorg/modules/core/syntax/module.lua b/lua/neorg/modules/core/syntax/module.lua index dcb795871..1e0025ad2 100644 --- a/lua/neorg/modules/core/syntax/module.lua +++ b/lua/neorg/modules/core/syntax/module.lua @@ -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,