Skip to content

Commit 7516196

Browse files
author
John Mutuma (from Dev Box)
committed
fix(context): normalize file paths for Windows compatibility
1 parent 7c20424 commit 7516196

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lua/sidekick/cli/context/location.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ function M.get(ctx, opts)
1919
opts.kind = opts.kind or "position"
2020
assert(ctx.buf or ctx.name, "Either buf or name must be provided")
2121

22-
local name = ctx.name or vim.api.nvim_buf_get_name(ctx.buf)
22+
local name = ctx.name or vim.fs.normalize(vim.api.nvim_buf_get_name(ctx.buf))
2323
if not name or name == "" then
2424
name = "[No Name]"
2525
else
26-
local cwd = ctx.cwd or vim.fn.getcwd(0)
26+
local cwd = ctx.cwd or vim.fs.normalize(vim.fn.getcwd(0))
2727
local ok, rel = pcall(vim.fs.relpath, cwd, name)
2828
if ok and rel and rel ~= "" and rel ~= "." then
2929
name = rel

0 commit comments

Comments
 (0)