diff options
Diffstat (limited to 'runtime/lua/vim')
| -rw-r--r-- | runtime/lua/vim/_core/editor.lua | 2 | ||||
| -rw-r--r-- | runtime/lua/vim/fs.lua | 4 | ||||
| -rw-r--r-- | runtime/lua/vim/net.lua | 8 | ||||
| -rw-r--r-- | runtime/lua/vim/range.lua | 1 |
4 files changed, 7 insertions, 8 deletions
diff --git a/runtime/lua/vim/_core/editor.lua b/runtime/lua/vim/_core/editor.lua index cce49b6b7b..963d67dbde 100644 --- a/runtime/lua/vim/_core/editor.lua +++ b/runtime/lua/vim/_core/editor.lua @@ -655,7 +655,7 @@ end --- Convert UTF-32, UTF-16 or UTF-8 {index} to byte index. --- If {strict_indexing} is false ---- then then an out of range index will return byte length +--- then an out of range index will return byte length --- instead of throwing an error. --- --- Invalid UTF-8 and NUL is treated like in |vim.str_utfindex()|. diff --git a/runtime/lua/vim/fs.lua b/runtime/lua/vim/fs.lua index 4baa6b02db..0deacc536c 100644 --- a/runtime/lua/vim/fs.lua +++ b/runtime/lua/vim/fs.lua @@ -809,8 +809,8 @@ function M.relpath(base, target, opts) vim.validate('target', target, 'string') vim.validate('opts', opts, 'table', true) - base = vim.fs.normalize(vim.fs.abspath(base)) - target = vim.fs.normalize(vim.fs.abspath(target)) + base = M.normalize(M.abspath(base)) + target = M.normalize(M.abspath(target)) if base == target then return '.' end diff --git a/runtime/lua/vim/net.lua b/runtime/lua/vim/net.lua index 073a240a89..910198fb9b 100644 --- a/runtime/lua/vim/net.lua +++ b/runtime/lua/vim/net.lua @@ -15,11 +15,9 @@ local M = {} --- completion. The `body` field in the response object contains the raw response data (text or binary). --- Called with (err, nil) on failure, or (nil, { body = string|boolean }) on success. function M.request(url, opts, on_response) - vim.validate({ - url = { url, 'string' }, - opts = { opts, 'table', true }, - on_response = { on_response, 'function' }, - }) + vim.validate('url', url, 'string') + vim.validate('opts', opts, 'table', true) + vim.validate('on_response', on_response, 'function') opts = opts or {} local retry = opts.retry or 3 diff --git a/runtime/lua/vim/range.lua b/runtime/lua/vim/range.lua index 50f5a795e6..d467e6c0c6 100644 --- a/runtime/lua/vim/range.lua +++ b/runtime/lua/vim/range.lua @@ -143,6 +143,7 @@ end --- ``` ---@param range vim.Range ---@param position_encoding lsp.PositionEncodingKind +---@return lsp.Range function Range.to_lsp(range, position_encoding) validate('range', range, 'table') validate('position_encoding', position_encoding, 'string', true) |
