diff options
author | dundargoc <gocdundar@gmail.com> | 2025-01-02 16:29:00 +0100 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2025-01-04 21:48:45 +0100 |
commit | a8ace2c58a318552869462a36859aabf1cdfaa68 (patch) | |
tree | 4e61c3e4ba917df80f62c1fd6db85f9a4eef1503 /runtime/lua/vim/fs.lua | |
parent | 69aa33d890468c1024beef0d97d0f9424516c9ef (diff) | |
download | rneovim-a8ace2c58a318552869462a36859aabf1cdfaa68.tar.gz rneovim-a8ace2c58a318552869462a36859aabf1cdfaa68.tar.bz2 rneovim-a8ace2c58a318552869462a36859aabf1cdfaa68.zip |
fix(vim.fs.normalize): normalize case for windows drive letter
Also add tests for the current path casing behavior so it doesn't get
accidentally changed.
Diffstat (limited to 'runtime/lua/vim/fs.lua')
-rw-r--r-- | runtime/lua/vim/fs.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/lua/vim/fs.lua b/runtime/lua/vim/fs.lua index ee713e4b58..04a6e43db1 100644 --- a/runtime/lua/vim/fs.lua +++ b/runtime/lua/vim/fs.lua @@ -629,8 +629,8 @@ function M.normalize(path, opts) return prefix .. path end - -- Remove extraneous slashes from the prefix - prefix = prefix:gsub('/+', '/') + -- Ensure capital drive and remove extraneous slashes from the prefix + prefix = prefix:gsub('^%a:', string.upper):gsub('/+', '/') end if not opts._fast then |