Skip to content

Commit

Permalink
fix(formatter): absolute paths on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Apr 28, 2024
1 parent 6df9225 commit 9ab1f67
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/fzf-lua/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9ab1f67

Please sign in to comment.