Skip to content

Commit

Permalink
fix(filesystem): normalize mixed path separators in Windows (#1258)
Browse files Browse the repository at this point in the history
  • Loading branch information
gplusplus314 committed Dec 10, 2023
1 parent 9298c1b commit 77d9f48
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/neo-tree/utils/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,11 @@ M.normalize_path = function(path)
if M.is_windows then
-- normalize the drive letter to uppercase
path = path:sub(1, 1):upper() .. path:sub(2)
-- Turn mixed forward and back slashes into all forward slashes
-- using NeoVim's logic
path = vim.fs.normalize(path)
-- Now use backslashes, as expected by the rest of Neo-Tree's code
path = path:gsub("/", M.path_separator)
end
return path
end
Expand Down

0 comments on commit 77d9f48

Please sign in to comment.