diff options
author | Lewis Russell <lewis6991@gmail.com> | 2023-06-03 11:06:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-03 12:06:00 +0200 |
commit | 2db719f6c2b677fcbc197b02fe52764a851523b2 (patch) | |
tree | 648885f655ea6eea2d6b5ad9409bc18c3b49e0f7 /runtime | |
parent | c65e2203f70cd5d66fcb8ffb26f8cef38f50e04f (diff) | |
download | rneovim-2db719f6c2b677fcbc197b02fe52764a851523b2.tar.gz rneovim-2db719f6c2b677fcbc197b02fe52764a851523b2.tar.bz2 rneovim-2db719f6c2b677fcbc197b02fe52764a851523b2.zip |
feat(lua): rename vim.loop -> vim.uv (#22846)
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/builtin.txt | 4 | ||||
-rw-r--r-- | runtime/doc/deprecated.txt | 1 | ||||
-rw-r--r-- | runtime/doc/help.txt | 2 | ||||
-rw-r--r-- | runtime/doc/lua.txt | 35 | ||||
-rw-r--r-- | runtime/doc/luvref.txt | 6 | ||||
-rw-r--r-- | runtime/doc/news.txt | 2 | ||||
-rw-r--r-- | runtime/lua/_vim9script.lua | 2 | ||||
-rw-r--r-- | runtime/lua/man.lua | 8 | ||||
-rw-r--r-- | runtime/lua/nvim/health.lua | 2 | ||||
-rw-r--r-- | runtime/lua/provider/health.lua | 6 | ||||
-rw-r--r-- | runtime/lua/vim/_editor.lua | 8 | ||||
-rw-r--r-- | runtime/lua/vim/_watch.lua | 6 | ||||
-rw-r--r-- | runtime/lua/vim/filetype/options.lua | 2 | ||||
-rw-r--r-- | runtime/lua/vim/fs.lua | 20 | ||||
-rw-r--r-- | runtime/lua/vim/loader.lua | 4 | ||||
-rw-r--r-- | runtime/lua/vim/lsp.lua | 2 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/health.lua | 2 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/log.lua | 4 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/rpc.lua | 4 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/semantic_tokens.lua | 2 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/util.lua | 2 | ||||
-rw-r--r-- | runtime/lua/vim/secure.lua | 6 | ||||
-rw-r--r-- | runtime/lua/vim/treesitter/languagetree.lua | 4 |
23 files changed, 68 insertions, 66 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 7acc764644..27d52b7ac6 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -3927,8 +3927,8 @@ has({feature}) Returns 1 if {feature} is supported, 0 otherwise. The {feature} argument is a feature name like "nvim-0.2.1" or "win32", see below. See also |exists()|. - To get the system name use |vim.loop|.os_uname() in Lua: > - :lua print(vim.loop.os_uname().sysname) + To get the system name use |vim.uv|.os_uname() in Lua: >lua + print(vim.uv.os_uname().sysname) < If the code has a syntax error then Vimscript may skip the rest of the line. Put |:if| and |:endif| on separate lines to diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt index 9d4a7324bf..6494c53059 100644 --- a/runtime/doc/deprecated.txt +++ b/runtime/doc/deprecated.txt @@ -144,6 +144,7 @@ TREESITTER FUNCTIONS LUA - vim.register_keystroke_callback() Use |vim.on_key()| instead. - *vim.pretty_print()* Use |vim.print()| instead. +- *vim.loop* Use |vim.uv| instead. NORMAL COMMANDS - *]f* *[f* Same as "gf". diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt index a1550d5c8b..aefaa0b7df 100644 --- a/runtime/doc/help.txt +++ b/runtime/doc/help.txt @@ -105,7 +105,7 @@ API (EXTENSIBILITY/SCRIPTING/PLUGINS) |lua-guide| Nvim Lua guide |lua| Lua API |luaref| Lua reference manual -|luvref| Luv (|vim.loop|) reference manual +|luvref| Luv (|vim.uv|) reference manual |autocmd| Event handlers |job-control| Spawn and control multiple processes |channel| Nvim asynchronous IO diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index da423ac213..54527c5a50 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -449,29 +449,24 @@ Note that underscore-prefixed functions (e.g. "_os_proc_children") are internal/private and must not be used by plugins. ------------------------------------------------------------------------------ -VIM.LOOP *lua-loop* *vim.loop* +VIM.UV *lua-loop* *vim.uv* -`vim.loop` exposes all features of the Nvim event-loop. This is a low-level -API that provides functionality for networking, filesystem, and process -management. Try this command to see available functions: >vim - - :lua print(vim.inspect(vim.loop)) -< -Internally, `vim.loop` wraps the "luv" Lua bindings for the LibUV library; -see |luv-intro| for a full reference manual. +`vim.uv` exposes the "luv" Lua bindings for the libUV library that Nvim uses +for networking, filesystem, and process management, see |luvref.txt|. +In particular, it allows interacting with the main Nvim |luv-event-loop|. *E5560* *lua-loop-callbacks* It is an error to directly invoke `vim.api` functions (except |api-fast|) in -`vim.loop` callbacks. For example, this is an error: >lua +`vim.uv` callbacks. For example, this is an error: >lua - local timer = vim.loop.new_timer() + local timer = vim.uv.new_timer() timer:start(1000, 0, function() vim.api.nvim_command('echomsg "test"') end) < To avoid the error use |vim.schedule_wrap()| to defer the callback: >lua - local timer = vim.loop.new_timer() + local timer = vim.uv.new_timer() timer:start(1000, 0, vim.schedule_wrap(function() vim.api.nvim_command('echomsg "test"') end)) @@ -484,7 +479,7 @@ Example: repeating timer 2. Execute it with ":luafile %". >lua -- Create a timer handle (implementation detail: uv_timer_t). - local timer = vim.loop.new_timer() + local timer = vim.uv.new_timer() local i = 0 -- Waits 1000ms, then repeats every 750ms until timer:close(). timer:start(1000, 750, function() @@ -504,7 +499,7 @@ Example: File-change detection *watch-file* 5. Observe that the file reloads in Nvim (because on_change() calls |:checktime|). >lua - local w = vim.loop.new_fs_event() + local w = vim.uv.new_fs_event() local function on_change(err, fname, status) -- Do work... vim.api.nvim_command('checktime') @@ -528,11 +523,11 @@ Example: TCP echo-server *tcp-server* 4. Connect from any TCP client (e.g. "nc 0.0.0.0 36795"): >lua local function create_server(host, port, on_connect) - local server = vim.loop.new_tcp() + local server = vim.uv.new_tcp() server:bind(host, port) server:listen(128, function(err) assert(not err, err) -- Check for errors. - local sock = vim.loop.new_tcp() + local sock = vim.uv.new_tcp() server:accept(sock) -- Accept client connection. on_connect(sock) -- Start reading messages. end) @@ -553,14 +548,14 @@ Example: TCP echo-server *tcp-server* Multithreading *lua-loop-threading* Plugins can perform work in separate (os-level) threads using the threading -APIs in luv, for instance `vim.loop.new_thread`. Note that every thread +APIs in luv, for instance `vim.uv.new_thread`. Note that every thread gets its own separate lua interpreter state, with no access to lua globals in the main thread. Neither can the state of the editor (buffers, windows, etc) be directly accessed from threads. A subset of the `vim.*` API is available in threads. This includes: -- `vim.loop` with a separate event loop per thread. +- `vim.uv` with a separate event loop per thread. - `vim.mpack` and `vim.json` (useful for serializing messages between threads) - `require` in threads can use lua packages from the global |package.path| - `print()` and `vim.inspect` @@ -885,7 +880,7 @@ vim.defer_fn({fn}, {timeout}) *vim.defer_fn* • {timeout} Time in ms to wait before calling {fn} Returns: ~ - |vim.loop|.new_timer() object + |vim.uv|.new_timer() object vim.wait({time} [, {callback}, {interval}, {fast_only}]) *vim.wait()* Wait for {time} in milliseconds until {callback} returns `true`. @@ -2531,7 +2526,7 @@ find({names}, {opts}) *vim.fs.find()* -- location of Cargo.toml from the current buffer's path local cargo = vim.fs.find('Cargo.toml', { upward = true, - stop = vim.loop.os_homedir(), + stop = vim.uv.os_homedir(), path = vim.fs.dirname(vim.api.nvim_buf_get_name(0)), }) diff --git a/runtime/doc/luvref.txt b/runtime/doc/luvref.txt index 79dd1248aa..131e7889e4 100644 --- a/runtime/doc/luvref.txt +++ b/runtime/doc/luvref.txt @@ -5,8 +5,8 @@ *luvref* This file documents the Lua bindings for the LibUV library which is used for -Nvim's event-loop and is accessible from Lua via |vim.loop| (e.g., |uv.version()| -is exposed as `vim.loop.version()`). +Nvim's event-loop and is accessible from Lua via |vim.uv| (e.g., |uv.version()| +is exposed as `vim.uv.version()`). For information about this manual, see |luv-credits|. @@ -29,7 +29,7 @@ TCP Echo Server Example ~ Here is a small example showing a TCP echo server: >lua - local uv = vim.loop + local uv = vim.uv local server = uv.new_tcp() server:bind("127.0.0.1", 1337) diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 4c864312f5..d51227f0c0 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -129,4 +129,6 @@ release. - |nvim_win_get_option()| Use |nvim_get_option_value()| instead. - |nvim_win_set_option()| Use |nvim_set_option_value()| instead. +• `vim.loop` has been renamed to `vim.uv`. + vim:tw=78:ts=8:sw=2:et:ft=help:norl: diff --git a/runtime/lua/_vim9script.lua b/runtime/lua/_vim9script.lua index b983878637..ca0e913d51 100644 --- a/runtime/lua/_vim9script.lua +++ b/runtime/lua/_vim9script.lua @@ -513,7 +513,7 @@ vim9['import'] = (function() imported.absolute = setmetatable({}, { __index = function(self, name) - if vim.loop.fs_stat(name) then + if vim.uv.fs_stat(name) then local result = loadfile(name)() rawset(self, name, result) diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua index ac493bdc7f..09265b1999 100644 --- a/runtime/lua/man.lua +++ b/runtime/lua/man.lua @@ -21,13 +21,13 @@ end local function system(cmd_, silent, env) local stdout_data = {} ---@type string[] local stderr_data = {} ---@type string[] - local stdout = assert(vim.loop.new_pipe(false)) - local stderr = assert(vim.loop.new_pipe(false)) + local stdout = assert(vim.uv.new_pipe(false)) + local stderr = assert(vim.uv.new_pipe(false)) local done = false local exit_code ---@type integer? - -- We use the `env` command here rather than the env option to vim.loop.spawn since spawn will + -- We use the `env` command here rather than the env option to vim.uv.spawn since spawn will -- completely overwrite the environment when we just want to modify the existing one. -- -- Overwriting mainly causes problems NixOS which relies heavily on a non-standard environment. @@ -39,7 +39,7 @@ local function system(cmd_, silent, env) end local handle - handle = vim.loop.spawn(cmd[1], { + handle = vim.uv.spawn(cmd[1], { args = vim.list_slice(cmd, 2), stdio = { nil, stdout, stderr }, }, function(code) diff --git a/runtime/lua/nvim/health.lua b/runtime/lua/nvim/health.lua index 19303d34f9..7ccb082a40 100644 --- a/runtime/lua/nvim/health.lua +++ b/runtime/lua/nvim/health.lua @@ -30,7 +30,7 @@ local function check_runtime() local bad_files_msg = '' for k, _ in pairs(bad_files) do local path = ('%s/%s'):format(vim.env.VIMRUNTIME, k) - if vim.loop.fs_stat(path) then + if vim.uv.fs_stat(path) then bad_files[k] = true bad_files_msg = ('%s%s\n'):format(bad_files_msg, path) end diff --git a/runtime/lua/provider/health.lua b/runtime/lua/provider/health.lua index e0bfe57cb6..f2c19f53fb 100644 --- a/runtime/lua/provider/health.lua +++ b/runtime/lua/provider/health.lua @@ -5,7 +5,7 @@ local ok = vim.health.ok local info = vim.health.info local warn = vim.health.warn local error = vim.health.error -local iswin = vim.loop.os_uname().sysname == 'Windows_NT' +local iswin = vim.uv.os_uname().sysname == 'Windows_NT' local shell_error_code = 0 local function shell_error() @@ -30,7 +30,7 @@ local function isdir(path) if not path then return false end - local stat = vim.loop.fs_stat(path) + local stat = vim.uv.fs_stat(path) if not stat then return false end @@ -41,7 +41,7 @@ local function isfile(path) if not path then return false end - local stat = vim.loop.fs_stat(path) + local stat = vim.uv.fs_stat(path) if not stat then return false end diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua index b26def5958..7b946a55e4 100644 --- a/runtime/lua/vim/_editor.lua +++ b/runtime/lua/vim/_editor.lua @@ -42,6 +42,10 @@ for k, v in pairs({ vim._submodules[k] = v end +-- Remove at Nvim 1.0 +---@deprecated +vim.loop = vim.uv + -- There are things which have special rules in vim._init_packages -- for legacy reasons (uri) or for performance (_inspector). -- most new things should go into a submodule namespace ( vim.foobar.do_thing() ) @@ -159,7 +163,7 @@ do --- - 3: ends the paste (exactly once) ---@returns boolean # false if client should cancel the paste. function vim.paste(lines, phase) - local now = vim.loop.now() + local now = vim.uv.now() local is_first_chunk = phase < 2 local is_last_chunk = phase == -1 or phase == 3 if is_first_chunk then -- Reset flags. @@ -483,7 +487,7 @@ end ---@return table timer luv timer object function vim.defer_fn(fn, timeout) vim.validate({ fn = { fn, 'c', true } }) - local timer = vim.loop.new_timer() + local timer = vim.uv.new_timer() timer:start( timeout, 0, diff --git a/runtime/lua/vim/_watch.lua b/runtime/lua/vim/_watch.lua index dbffd726a2..3bd8a56f6e 100644 --- a/runtime/lua/vim/_watch.lua +++ b/runtime/lua/vim/_watch.lua @@ -46,7 +46,7 @@ function M.watch(path, opts, callback) path = vim.fs.normalize(path) local uvflags = opts and opts.uvflags or {} - local handle, new_err = vim.loop.new_fs_event() + local handle, new_err = vim.uv.new_fs_event() assert(not new_err, new_err) local _, start_err = handle:start(path, uvflags, function(err, filename, events) assert(not err, err) @@ -57,7 +57,7 @@ function M.watch(path, opts, callback) end local change_type = events.change and M.FileChangeType.Changed or 0 if events.rename then - local _, staterr, staterrname = vim.loop.fs_stat(fullpath) + local _, staterr, staterrname = vim.uv.fs_stat(fullpath) if staterrname == 'ENOENT' then change_type = M.FileChangeType.Deleted else @@ -99,7 +99,7 @@ local function poll_internal(path, opts, callback, watches) } if not watches.handle then - local poll, new_err = vim.loop.new_fs_poll() + local poll, new_err = vim.uv.new_fs_poll() assert(not new_err, new_err) watches.handle = poll local _, start_err = poll:start( diff --git a/runtime/lua/vim/filetype/options.lua b/runtime/lua/vim/filetype/options.lua index a093c249f7..2a28b5a8e3 100644 --- a/runtime/lua/vim/filetype/options.lua +++ b/runtime/lua/vim/filetype/options.lua @@ -34,7 +34,7 @@ local ft_option_cache = {} ---@type table<string,table<string,any>> --- @param path string --- @return integer local function hash(path) - local mtime0 = vim.loop.fs_stat(path).mtime + local mtime0 = vim.uv.fs_stat(path).mtime return mtime0.sec * 1000000000 + mtime0.nsec end diff --git a/runtime/lua/vim/fs.lua b/runtime/lua/vim/fs.lua index 864ba495f1..5e63fb6237 100644 --- a/runtime/lua/vim/fs.lua +++ b/runtime/lua/vim/fs.lua @@ -1,6 +1,6 @@ local M = {} -local iswin = vim.loop.os_uname().sysname == 'Windows_NT' +local iswin = vim.uv.os_uname().sysname == 'Windows_NT' --- Iterate over all the parents of the given file or directory. --- @@ -106,12 +106,12 @@ function M.dir(path, opts) }) if not opts.depth or opts.depth == 1 then - local fs = vim.loop.fs_scandir(M.normalize(path)) + local fs = vim.uv.fs_scandir(M.normalize(path)) return function() if not fs then return end - return vim.loop.fs_scandir_next(fs) + return vim.uv.fs_scandir_next(fs) end end @@ -121,9 +121,9 @@ function M.dir(path, opts) while #dirs > 0 do local dir0, level = unpack(table.remove(dirs, 1)) local dir = level == 1 and dir0 or M.joinpath(path, dir0) - local fs = vim.loop.fs_scandir(M.normalize(dir)) + local fs = vim.uv.fs_scandir(M.normalize(dir)) while fs do - local name, t = vim.loop.fs_scandir_next(fs) + local name, t = vim.uv.fs_scandir_next(fs) if not name then break end @@ -158,7 +158,7 @@ end --- -- location of Cargo.toml from the current buffer's path --- local cargo = vim.fs.find('Cargo.toml', { --- upward = true, ---- stop = vim.loop.os_homedir(), +--- stop = vim.uv.os_homedir(), --- path = vim.fs.dirname(vim.api.nvim_buf_get_name(0)), --- }) --- @@ -212,7 +212,7 @@ function M.find(names, opts) names = type(names) == 'string' and { names } or names - local path = opts.path or vim.loop.cwd() + local path = opts.path or vim.uv.cwd() local stop = opts.stop local limit = opts.limit or 1 @@ -244,7 +244,7 @@ function M.find(names, opts) local t = {} for _, name in ipairs(names) do local f = M.joinpath(p, name) - local stat = vim.loop.fs_stat(f) + local stat = vim.uv.fs_stat(f) if stat and (not opts.type or opts.type == stat.type) then t[#t + 1] = f end @@ -337,7 +337,7 @@ function M.normalize(path, opts) }) if path:sub(1, 1) == '~' then - local home = vim.loop.os_homedir() or '~' + local home = vim.uv.os_homedir() or '~' if home:sub(-1) == '\\' or home:sub(-1) == '/' then home = home:sub(1, -2) end @@ -345,7 +345,7 @@ function M.normalize(path, opts) end if opts.expand_env == nil or opts.expand_env then - path = path:gsub('%$([%w_]+)', vim.loop.os_getenv) + path = path:gsub('%$([%w_]+)', vim.uv.os_getenv) end path = path:gsub('\\', '/'):gsub('/+', '/') diff --git a/runtime/lua/vim/loader.lua b/runtime/lua/vim/loader.lua index 66627fe4e7..9024bdb231 100644 --- a/runtime/lua/vim/loader.lua +++ b/runtime/lua/vim/loader.lua @@ -1,4 +1,4 @@ -local uv = vim.loop +local uv = vim.uv --- @type (fun(modename: string): fun()|string)[] local loaders = package.loaders @@ -465,7 +465,7 @@ end --- @private function Loader.track(stat, f) return function(...) - local start = vim.loop.hrtime() + local start = vim.uv.hrtime() local r = { f(...) } Loader._stats[stat] = Loader._stats[stat] or { total = 0, time = 0 } Loader._stats[stat].total = Loader._stats[stat].total + 1 diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index baf8b5c1a8..5f7a95ae14 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -10,7 +10,7 @@ local semantic_tokens = require('vim.lsp.semantic_tokens') local api = vim.api local nvim_err_writeln, nvim_buf_get_lines, nvim_command, nvim_exec_autocmds = api.nvim_err_writeln, api.nvim_buf_get_lines, api.nvim_command, api.nvim_exec_autocmds -local uv = vim.loop +local uv = vim.uv local tbl_isempty, tbl_extend = vim.tbl_isempty, vim.tbl_extend local validate = vim.validate local if_nil = vim.F.if_nil diff --git a/runtime/lua/vim/lsp/health.lua b/runtime/lua/vim/lsp/health.lua index 6ca468393e..8817bb71de 100644 --- a/runtime/lua/vim/lsp/health.lua +++ b/runtime/lua/vim/lsp/health.lua @@ -22,7 +22,7 @@ function M.check() local log_path = vim.lsp.get_log_path() report_info(string.format('Log path: %s', log_path)) - local log_file = vim.loop.fs_stat(log_path) + local log_file = vim.uv.fs_stat(log_path) local log_size = log_file and log_file.size or 0 local report_fn = (log_size / 1000000 > 100 and report_warn or report_info) diff --git a/runtime/lua/vim/lsp/log.lua b/runtime/lua/vim/lsp/log.lua index 3d5bc06c3f..07d0500797 100644 --- a/runtime/lua/vim/lsp/log.lua +++ b/runtime/lua/vim/lsp/log.lua @@ -31,7 +31,7 @@ do end end - local path_sep = vim.loop.os_uname().version:match('Windows') and '\\' or '/' + local path_sep = vim.uv.os_uname().version:match('Windows') and '\\' or '/' ---@private local function path_join(...) return table.concat(vim.tbl_flatten({ ... }), path_sep) @@ -68,7 +68,7 @@ do return false end - local log_info = vim.loop.fs_stat(logfilename) + local log_info = vim.uv.fs_stat(logfilename) if log_info and log_info.size > 1e9 then local warn_msg = string.format( 'LSP client log is large (%d MB): %s', diff --git a/runtime/lua/vim/lsp/rpc.lua b/runtime/lua/vim/lsp/rpc.lua index af3190c9bd..5f48effebf 100644 --- a/runtime/lua/vim/lsp/rpc.lua +++ b/runtime/lua/vim/lsp/rpc.lua @@ -1,4 +1,4 @@ -local uv = vim.loop +local uv = vim.uv local log = require('vim.lsp.log') local protocol = require('vim.lsp.protocol') local validate, schedule, schedule_wrap = vim.validate, vim.schedule, vim.schedule_wrap @@ -691,7 +691,7 @@ local function start(cmd, cmd_args, dispatchers, extra_spawn_params) }) ---@private - --- Callback for |vim.loop.spawn()| Closes all streams and runs the `on_exit` dispatcher. + --- Callback for |vim.uv.spawn()| Closes all streams and runs the `on_exit` dispatcher. ---@param code (integer) Exit code ---@param signal (integer) Signal that was used to terminate (if any) local function onexit(code, signal) diff --git a/runtime/lua/vim/lsp/semantic_tokens.lua b/runtime/lua/vim/lsp/semantic_tokens.lua index 376cac19a7..191cc7b400 100644 --- a/runtime/lua/vim/lsp/semantic_tokens.lua +++ b/runtime/lua/vim/lsp/semantic_tokens.lua @@ -2,7 +2,7 @@ local api = vim.api local bit = require('bit') local handlers = require('vim.lsp.handlers') local util = require('vim.lsp.util') -local uv = vim.loop +local uv = vim.uv --- @class STTokenRange --- @field line integer line number 0-based diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 9fffc845b1..53f8dba814 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -4,7 +4,7 @@ local validate = vim.validate local api = vim.api local list_extend = vim.list_extend local highlight = require('vim.highlight') -local uv = vim.loop +local uv = vim.uv local npcall = vim.F.npcall local split = vim.split diff --git a/runtime/lua/vim/secure.lua b/runtime/lua/vim/secure.lua index 443b152273..1a04e11231 100644 --- a/runtime/lua/vim/secure.lua +++ b/runtime/lua/vim/secure.lua @@ -51,7 +51,7 @@ end --- trusted, or nil otherwise. function M.read(path) vim.validate({ path = { path, 's' } }) - local fullpath = vim.loop.fs_realpath(vim.fs.normalize(path)) + local fullpath = vim.uv.fs_realpath(vim.fs.normalize(path)) if not fullpath then return nil end @@ -149,13 +149,13 @@ function M.trust(opts) local fullpath if path then - fullpath = vim.loop.fs_realpath(vim.fs.normalize(path)) + fullpath = vim.uv.fs_realpath(vim.fs.normalize(path)) elseif bufnr then local bufname = vim.api.nvim_buf_get_name(bufnr) if bufname == '' then return false, 'buffer is not associated with a file' end - fullpath = vim.loop.fs_realpath(vim.fs.normalize(bufname)) + fullpath = vim.uv.fs_realpath(vim.fs.normalize(bufname)) else error('one of "path" or "bufnr" is required') end diff --git a/runtime/lua/vim/treesitter/languagetree.lua b/runtime/lua/vim/treesitter/languagetree.lua index 244d88f3e0..cabfa8ccc0 100644 --- a/runtime/lua/vim/treesitter/languagetree.lua +++ b/runtime/lua/vim/treesitter/languagetree.lua @@ -170,11 +170,11 @@ end ---@param f fun(): R1, R2, R2 ---@return integer, R1, R2, R3 local function tcall(f, ...) - local start = vim.loop.hrtime() + local start = vim.uv.hrtime() ---@diagnostic disable-next-line local r = { f(...) } --- @type number - local duration = (vim.loop.hrtime() - start) / 1000000 + local duration = (vim.uv.hrtime() - start) / 1000000 return duration, unpack(r) end |