Skip to content

Commit 1a8c024

Browse files
committed
feat(file-history): customize the max length of commit subject before truncating
1 parent 4516612 commit 1a8c024

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

doc/diffview_defaults.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ DEFAULT CONFIG *diffview.defaults*
6262
},
6363
},
6464
file_history_panel = {
65+
max_len_commit_subject = 72,
6566
log_options = { -- See |diffview-config-log_options|
6667
git = {
6768
single_file = {

lua/diffview/config.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ M.defaults = {
8383
},
8484
},
8585
file_history_panel = {
86+
max_len_commit_subject = 72,
8687
log_options = {
8788
---@type ConfigLogOptions
8889
git = {

lua/diffview/scene/views/file_history/render.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ local function render_entries(panel, parent, entries, updating)
142142
comp:add_text((" (%s)"):format(entry.commit.ref_names), "DiffviewReference")
143143
end
144144

145-
local subject = utils.str_trunc(entry.commit.subject, 72)
145+
local subject = utils.str_trunc(entry.commit.subject, c.file_history_panel.max_len_commit_subject)
146146

147147
if subject == "" then
148148
subject = "[empty message]"

0 commit comments

Comments
 (0)