From dcd059d1b69ac6fee0c3f49c55b12c6bdcad38c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauritz=20Sj=C3=B6din?= Date: Fri, 10 Apr 2026 21:55:28 +0200 Subject: [PATCH] feat: add a config option to show file paths when staging --- README.md | 1 + lua/tinygit/commands/stage/telescope.lua | 2 +- lua/tinygit/config.lua | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) 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 = {