aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configs/nvim/config-root/lua/crupest/utils/fs.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/configs/nvim/config-root/lua/crupest/utils/fs.lua b/configs/nvim/config-root/lua/crupest/utils/fs.lua
index d34c2f6..f1363ff 100644
--- a/configs/nvim/config-root/lua/crupest/utils/fs.lua
+++ b/configs/nvim/config-root/lua/crupest/utils/fs.lua
@@ -1,3 +1,5 @@
+local is_win = vim.fn.has("win32") ~= 0
+
local function clean_path(path)
if path == "/" then return path end
path = string.gsub(path, "[/\\]+", "/")
@@ -8,6 +10,7 @@ local function clean_path(path)
end
local function full_path(name)
+ if is_win and string.match(name, "^[a-zA-Z]:[/\\]?$") then return clean_path(name) end
local path = vim.fn.fnamemodify(name, ":p")
return clean_path(path)
end