@@ -94,9 +94,12 @@ local function highlightPreviewWin(bufnr, stagedLines, diffstatLines)
9494 vim .fn .matchadd (hl [1 ], pattern )
9595 end
9696
97- -- highlight diffstat for UNSTAGED lines
97+ -- highlight diffstat for UNSTAGED lines (if any)
9898 local ns = vim .api .nvim_create_namespace (" tinygit.commitPreview" )
99- vim .hl .range (bufnr , ns , " Comment" , { stagedLines , 0 }, { diffstatLines , 0 }, { priority = 1000 })
99+ vim .hl .range (bufnr , ns , " Comment" , { stagedLines , 0 }, { diffstatLines - 1 , - 1 })
100+
101+ -- highlight separator line
102+ vim .hl .range (bufnr , ns , " NonText" , { diffstatLines , 0 }, { diffstatLines , - 1 })
100103
101104 -- highlight log lines
102105 local highlights = require (" tinygit.shared.highlights" )
@@ -114,7 +117,7 @@ function M.createWin(mode, inputWinid)
114117 local textWidth = inputWin .width - 2
115118 local diffStatLines , summary , stagedLinesCount = M .getDiffStats (mode , textWidth )
116119 local diffstatLineCount = # diffStatLines -- save, since `list_extend` mutates
117- table.insert (diffStatLines , " " ) -- line break
120+ table.insert (diffStatLines , ( " ─ " ): rep ( textWidth )) -- separator
118121 local logLines = M .getGitLog ()
119122 local previewLines = vim .list_extend (diffStatLines , logLines )
120123
@@ -142,7 +145,7 @@ function M.createWin(mode, inputWinid)
142145 vim .bo [bufnr ].filetype = " tinygit.diffstats"
143146 vim .wo [winid ].statuscolumn = " " -- = left-padding
144147
145- vim .wo [winid ].winhighlight = " FloatFooter:NonText ,FloatBorder:Comment,Normal:Normal"
148+ vim .wo [winid ].winhighlight = " FloatFooter:Comment ,FloatBorder:Comment,Normal:Normal"
146149 vim .api .nvim_win_call (
147150 winid ,
148151 function () highlightPreviewWin (bufnr , stagedLinesCount , diffstatLineCount ) end
0 commit comments