fix(parser): emit hunks for files with unknown filetypes

Previously, hunks were discarded entirely if vim.filetype.match()
returned nil. This meant files with unrecognized extensions got no
highlighting at all - not even the basic green/red backgrounds for
added/deleted lines.

Remove the (current_lang or current_ft) condition from flush_hunk()
so all hunks are collected. highlight_hunk() already handles the
case where ft/lang are nil by skipping syntax highlighting but still
applying background colors.

Co-authored-by: phanen <phanen@qq.com>
This commit is contained in:
Barrett Ruth 2026-02-04 23:51:15 -05:00
parent 83f6069d49
commit 980bedc8a6
2 changed files with 20 additions and 1 deletions

View file

@ -68,7 +68,7 @@ function M.parse_buffer(bufnr)
local header_lines = {}
local function flush_hunk()
if hunk_start and #hunk_lines > 0 and (current_lang or current_ft) then
if hunk_start and #hunk_lines > 0 then
local hunk = {
filename = current_filename,
ft = current_ft,