From a8ace2c58a318552869462a36859aabf1cdfaa68 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Thu, 2 Jan 2025 16:29:00 +0100 Subject: 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. --- runtime/lua/vim/fs.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/lua/vim/fs.lua') 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 -- cgit