fix(highlight,parser,init): line_hl_group, clear_end, did_filetype, email-quoted diffs
Problem: line backgrounds used `hl_group + end_row` multirow extmarks vulnerable to adjacent `clear_namespace`. `clear_end` was off by one. `vim.filetype.match` returned nil for function-handled extensions (`.sh`, `.bash`, etc.) when `did_filetype() != 0`. Parser didn't handle email-quoted diff prefixes (`> `). Solution: use `line_hl_group` single-point extmarks. Fix `clear_end` to `hunk.start_line + #hunk.lines`. Override `vim.fn.did_filetype` via `rawset` during retry. Strip `> ` quote prefixes in parser and store `quote_width` per hunk.
This commit is contained in:
parent
0f0acacf96
commit
13c0ea1e92
9 changed files with 552 additions and 52 deletions
|
|
@ -496,17 +496,10 @@ function M.highlight_hunk(bufnr, ns, hunk, opts)
|
|||
|
||||
if opts.highlights.background and is_diff_line then
|
||||
pcall(vim.api.nvim_buf_set_extmark, bufnr, ns, buf_line, 0, {
|
||||
end_row = buf_line + 1,
|
||||
hl_group = line_hl,
|
||||
hl_eol = true,
|
||||
line_hl_group = line_hl,
|
||||
number_hl_group = opts.highlights.gutter and number_hl or nil,
|
||||
priority = p.line_bg,
|
||||
})
|
||||
if opts.highlights.gutter then
|
||||
pcall(vim.api.nvim_buf_set_extmark, bufnr, ns, buf_line, 0, {
|
||||
number_hl_group = number_hl,
|
||||
priority = p.line_bg,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
if is_marker and line_len > pw then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue