We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c20424 commit c82264aCopy full SHA for c82264a
1 file changed
lua/sidekick/cli/context/location.lua
@@ -19,14 +19,14 @@ function M.get(ctx, opts)
19
opts.kind = opts.kind or "position"
20
assert(ctx.buf or ctx.name, "Either buf or name must be provided")
21
22
- local name = ctx.name or vim.api.nvim_buf_get_name(ctx.buf)
+ local name = vim.fs.normalize(ctx.name or vim.api.nvim_buf_get_name(ctx.buf))
23
if not name or name == "" then
24
name = "[No Name]"
25
else
26
- local cwd = ctx.cwd or vim.fn.getcwd(0)
+ local cwd = ctx.cwd or vim.fs.normalize(vim.fn.getcwd(0))
27
local ok, rel = pcall(vim.fs.relpath, cwd, name)
28
if ok and rel and rel ~= "" and rel ~= "." then
29
- name = rel
+ name = rel:gsub("\\", "/")
30
end
31
32
0 commit comments