diff options
author | Maria José Solano <majosolano99@gmail.com> | 2023-09-20 19:03:40 -0700 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2023-09-23 23:46:45 +0100 |
commit | bc0bf9d030bbcb01db69c44cf88b95ca41dd3065 (patch) | |
tree | e3c25c261ac4af8c4c6a5f3f66d786aec1e5b613 /runtime/lua/vim/uri.lua | |
parent | 01be28b370987447c78f313a65fdc289d79d4d8a (diff) | |
download | rneovim-bc0bf9d030bbcb01db69c44cf88b95ca41dd3065.tar.gz rneovim-bc0bf9d030bbcb01db69c44cf88b95ca41dd3065.tar.bz2 rneovim-bc0bf9d030bbcb01db69c44cf88b95ca41dd3065.zip |
docs: fix type warnings
Diffstat (limited to 'runtime/lua/vim/uri.lua')
-rw-r--r-- | runtime/lua/vim/uri.lua | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/runtime/lua/vim/uri.lua b/runtime/lua/vim/uri.lua index 9dce80b77e..2dc817c5c1 100644 --- a/runtime/lua/vim/uri.lua +++ b/runtime/lua/vim/uri.lua @@ -60,7 +60,7 @@ end ---@param path string Path to file ---@return string URI function M.uri_from_fname(path) - local volume_path, fname = path:match('^([a-zA-Z]:)(.*)') + local volume_path, fname = path:match('^([a-zA-Z]:)(.*)') ---@type string? local is_windows = volume_path ~= nil if is_windows then path = volume_path .. M.uri_encode(fname:gsub('\\', '/')) @@ -82,7 +82,7 @@ function M.uri_from_bufnr(bufnr) local fname = vim.api.nvim_buf_get_name(bufnr) local volume_path = fname:match('^([a-zA-Z]:).*') local is_windows = volume_path ~= nil - local scheme + local scheme ---@type string? if is_windows then fname = fname:gsub('\\', '/') scheme = fname:match(WINDOWS_URI_SCHEME_PATTERN) @@ -107,10 +107,9 @@ function M.uri_to_fname(uri) uri = M.uri_decode(uri) --TODO improve this. if is_windows_file_uri(uri) then - uri = uri:gsub('^file:/+', '') - uri = uri:gsub('/', '\\') + uri = uri:gsub('^file:/+', ''):gsub('/', '\\') else - uri = uri:gsub('^file:/+', '/') + uri = uri:gsub('^file:/+', '/') ---@type string end return uri end |