@@ -28,6 +28,8 @@ function M.getDiffStats(mode, width)
2828 :gsub (" deletions?" , " " )
2929 :gsub (" [()]" , " " )
3030 :gsub (" ," , " " )
31+ :gsub (" files?" , " %0," )
32+ :gsub (" " , " " )
3133
3234 local cleanedOutput = vim .tbl_map (function (line )
3335 local cleanLine = line
@@ -79,7 +81,7 @@ local function highlightPreviewWin(bufnr, stagedLines, diffstatLines)
7981 { " Keyword" , [[ (gone.*)]] },
8082 { " Function" , [[ .*\ze/]] }, -- directory of a file
8183 { " WarningMsg" , " /" }, -- path separator
82- { " Comment" , " │" }, -- path separator
84+ { " Comment" , " │" }, -- vertical separator
8385 }
8486 local endToken = " \\ %<" .. stagedLines + 1 .. " l" -- limit pattern to range, see :help \%<l
8587 for _ , hl in ipairs (highlightPatterns ) do
@@ -138,12 +140,11 @@ function M.createWin(mode, inputWinid)
138140 state .bufnr = bufnr
139141 state .winid = winid
140142 state .diffHeight = # previewLines
141- M .adaptWinPosition (inputWin )
142-
143143 vim .bo [bufnr ].filetype = " tinygit.diffstats"
144144 vim .wo [winid ].statuscolumn = " " -- = left-padding
145-
146145 vim .wo [winid ].winhighlight = " FloatFooter:Comment,FloatBorder:Comment,Normal:Normal"
146+
147+ M .adaptWinPosition (inputWin )
147148 vim .api .nvim_win_call (
148149 winid ,
149150 function () highlightPreviewWin (bufnr , stagedLinesCount , diffstatLineCount ) end
0 commit comments