Skip to content

Commit 844aed7

Browse files
committed
add comments for utils.norm_path
1 parent 1a78246 commit 844aed7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lua/nvim-tree/utils.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ local has_cygpath = vim.fn.executable "cygpath" == 1
1010
M.is_unix = vim.fn.has "unix" == 1
1111
M.is_macos = vim.fn.has "mac" == 1 or vim.fn.has "macunix" == 1
1212
M.is_wsl = vim.fn.has "wsl" == 1
13-
-- false for WSL
1413
M.is_windows = vim.fn.has "win32" == 1 or vim.fn.has "win32unix" == 1
1514

1615
function M.path_to_matching_str(path)
@@ -44,6 +43,11 @@ function M.path_split(path)
4443
return path:gmatch("[^" .. path_separator .. "]+" .. path_separator .. "?")
4544
end
4645

46+
--- Normalise a path:
47+
--- windows: replace slashes with backslashes
48+
--- cygwin: resolve path first via cygpath
49+
--- @param path string
50+
--- @return string|nil nil on cygpath failure
4751
function M.norm_path(path)
4852
if M.is_windows then
4953
-- msys2 git support

0 commit comments

Comments
 (0)