diff --git a/lua/orgmode/utils/fs.lua b/lua/orgmode/utils/fs.lua index d06c2883e..79dd586ab 100644 --- a/lua/orgmode/utils/fs.lua +++ b/lua/orgmode/utils/fs.lua @@ -111,7 +111,10 @@ function M.trim_common_root(paths) end, paths) end - local root = '/' .. table.concat(common_root, '/') .. '/' + local root = table.concat(common_root, '/') .. '/' + if vim.fn.has('win32') == 0 then + root = '/' .. root + end local result = {} for _, path in ipairs(paths) do local relative_path = path:sub(#root + 1)