Skip to content

Commit dac30a4

Browse files
Mauritz8chrisgrieser
authored andcommitted
feat: add a config option to show file paths when staging
1 parent 518f7a8 commit dac30a4

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ require("tinygit").setup {
117117
resetHunk = "<C-r>",
118118
},
119119
moveToNextHunkOnStagingToggle = false,
120+
showFilePaths = false,
120121

121122
-- accepts the common telescope picker config
122123
telescopeOpts = {

lua/tinygit/commands/stage/telescope.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ local function newFinder(hunks)
3333
local h = _entry.value
3434
local changeWithoutHunk = h.lnum == -1
3535

36-
local name = vim.fs.basename(h.relPath)
36+
local name = conf.showFilePaths and h.relPath or vim.fs.basename(h.relPath)
3737
local added = h.added > 0 and (" +" .. h.added) or ""
3838
local del = h.removed > 0 and (" -" .. h.removed) or ""
3939
local location = ""

lua/tinygit/config.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ local defaultConfig = {
2323
resetHunk = "<C-r>",
2424
},
2525
moveToNextHunkOnStagingToggle = false,
26+
showFilePaths = false,
2627

2728
-- accepts the common telescope picker config
2829
telescopeOpts = {

0 commit comments

Comments
 (0)