diff --git a/README.md b/README.md index 85255dd..3b5d270 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,7 @@ require("tinygit").setup { resetHunk = "", }, moveToNextHunkOnStagingToggle = false, + showFilePaths = false, -- accepts the common telescope picker config telescopeOpts = { diff --git a/lua/tinygit/commands/stage/telescope.lua b/lua/tinygit/commands/stage/telescope.lua index 6227f05..969137f 100644 --- a/lua/tinygit/commands/stage/telescope.lua +++ b/lua/tinygit/commands/stage/telescope.lua @@ -33,7 +33,7 @@ local function newFinder(hunks) local h = _entry.value local changeWithoutHunk = h.lnum == -1 - local name = vim.fs.basename(h.relPath) + local name = conf.showFilePaths and h.relPath or vim.fs.basename(h.relPath) local added = h.added > 0 and (" +" .. h.added) or "" local del = h.removed > 0 and (" -" .. h.removed) or "" local location = "" diff --git a/lua/tinygit/config.lua b/lua/tinygit/config.lua index 5db2c63..115c5ab 100644 --- a/lua/tinygit/config.lua +++ b/lua/tinygit/config.lua @@ -23,6 +23,7 @@ local defaultConfig = { resetHunk = "", }, moveToNextHunkOnStagingToggle = false, + showFilePaths = false, -- accepts the common telescope picker config telescopeOpts = {