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.
This commit is contained in:
dundargoc
2025-01-02 16:29:00 +01:00
committed by dundargoc
parent 69aa33d890
commit a8ace2c58a
2 changed files with 28 additions and 2 deletions

View File

@@ -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