From 9ab1f676751966a6f4a2886ee28c4ab4e155effd Mon Sep 17 00:00:00 2001 From: bhagwan Date: Sun, 28 Apr 2024 16:55:02 -0700 Subject: [PATCH] fix(formatter): absolute paths on Windows --- lua/fzf-lua/defaults.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/fzf-lua/defaults.lua b/lua/fzf-lua/defaults.lua index d5f20f36..859e1a8f 100644 --- a/lua/fzf-lua/defaults.lua +++ b/lua/fzf-lua/defaults.lua @@ -210,6 +210,9 @@ M.defaults = { local last = parts[parent_idx] local filename = parts[parent_idx - 1] local parent = last:match("^[^:]+") + if utils.__IS_WINDOWS and last:match("%a:") then + parent = last:sub(1, 2) .. #last > 2 and last:sub(3):match("^[^:]+") or "" + end local fullpath = path.join({ parent, filename }) -- remove the last part (parent + rest of line) table.remove(parts, parent_idx)