From 2d83b1a5c3fe5b2251866f5263fb9607db8d64c0 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 7 Jul 2024 05:36:38 +0200 Subject: [PATCH] fix: windows --- lua/persistence/init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/persistence/init.lua b/lua/persistence/init.lua index 9ec43de..bf0be75 100644 --- a/lua/persistence/init.lua +++ b/lua/persistence/init.lua @@ -101,6 +101,9 @@ function M.select() local file = session:sub(#Config.options.dir + 1, -5) local dir, branch = unpack(vim.split(file, "%%", { plain = true })) dir = dir:gsub("%%", "/") + if jit.os:find("Windows") then + dir = dir:gsub("^(%w)/", "%1:/") + end if not have[dir] then have[dir] = true items[#items + 1] = { session = session, dir = dir, branch = branch }