From 51ead9a68ff91d3620787e1f5863eb65b1cebaa8 Mon Sep 17 00:00:00 2001 From: basham00 Date: Thu, 14 Nov 2024 16:00:14 -0500 Subject: [PATCH] fix: Windows root path formatting --- lua/sf/util.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/sf/util.lua b/lua/sf/util.lua index 6e7338c..4ff6ae0 100644 --- a/lua/sf/util.lua +++ b/lua/sf/util.lua @@ -36,7 +36,10 @@ end M.get_default_dir_path = function() local dir_path = M.get_sf_root() .. vim.g.sf.default_dir dir_path = dir_path:gsub("//", "/") - if dir_path:sub(1, 1) ~= "/" and dir_path:sub(1, 1) ~= "." then + if M.is_windows_os() then + dir_path = dir_path:gsub("\\", "/") + end + if dir_path:sub(1, 1) ~= "/" and dir_path:sub(1, 1) ~= "." and not M.is_windows_os() then dir_path = "/" .. dir_path end if dir_path:sub(-1) ~= "/" then