Skip to content

Commit 9c74653

Browse files
DooezFabijanZulj
authored andcommitted
Added commit row and filepath arguments to custom full commit info function.
1 parent a1a3c88 commit 9c74653

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ These are the fields you can configure by passing them to the `require('blame').
7676
- `max_summary_width` - If date_message is used, cut the summary if it excedes this number of characters
7777
- `colors` - list of RGB strings to use instead of randomly generated RGBs for highlights
7878
- `blame_options` - list of blame options to use for git blame. If nil, then no options are used
79-
- `commit_detail_view` - string or function - "tab"|"split"|"vsplit"|"current" - Open commit details in a new tab, split, vsplit or current buffer
80-
`function(commit_hash) ... end` - Calls function and passes commit hash to it
79+
- `commit_detail_view` - string | function - "tab"|"split"|"vsplit"|"current" - Open commit details in a new tab, split, vsplit or current buffer
80+
`function(commit_hash, row, file_pat) ... end` - Calls function and passes commit hash, caller current row and file path
8181
- `format_fn` - format function that is used for processing of porcelain lines. See below for details
8282
( built-in: `("blame.formats.default_formats").date_message` and `("blame.formats.default_formats").commit_date_author_fn` )
8383
- `mappings` - custom mappings for various actions, you can pass in single or multiple mappings for an action.

lua/blame/views/window_view.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,8 @@ function WindowView:show_full_commit()
343343
local commit = self.blamed_lines[row]
344344
local view = self.config.commit_detail_view or "tab"
345345
if type(view) == 'function' then
346-
view(commit.hash)
346+
local path = self.blame_stack_client.file_path
347+
view(commit.hash, row, path)
347348
return
348349
end
349350

0 commit comments

Comments
 (0)