Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lua/sidekick/cli/context/location.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local Config = require("sidekick.config")

local M = {}

---@class sidekick.context.Loc
Expand All @@ -22,7 +24,7 @@ function M.get(ctx, opts)
local name = ctx.name or vim.api.nvim_buf_get_name(ctx.buf)
if not name or name == "" then
name = "[No Name]"
else
elseif not Config.cli.absolute_paths then
local cwd = ctx.cwd or vim.fn.getcwd(0)
local ok, rel = pcall(vim.fs.relpath, cwd, name)
if ok and rel and rel ~= "" and rel ~= "." then
Expand Down
3 changes: 3 additions & 0 deletions lua/sidekick/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ local defaults = {
size = 0.5, -- size of the split (0-1 for percentage)
},
},
-- Send absolute file paths to CLI tools instead of paths relative to Neovim's cwd.
-- Useful when the agent runs from a different working directory (e.g. a parent).
absolute_paths = false,
--- Actual cli tool config is loaded from the runtime path `sk/cli/{tool}.lua` and merged with the config below.
--- For default configs, see https://github.com/folke/sidekick.nvim/tree/main/sk/cli
-- stylua: ignore
Expand Down