Skip to content

feat(highlight): warn when hunks exceed max_lines#184

Merged
barrettruth merged 3 commits intomainfrom
feat/warn-max-lines
Mar 10, 2026
Merged

feat(highlight): warn when hunks exceed max_lines#184
barrettruth merged 3 commits intomainfrom
feat/warn-max-lines

Conversation

@barrettruth
Copy link
Owner

Problem

When a hunk's highlighted lines exceed max_lines, syntax highlighting is silently skipped. Users have no indication why parts of their diff lack highlighting.

Solution

Add highlights.warn_max_lines (default true) that emits a vim.notify warning with the hunk index and line count vs threshold. Also change max_lines to count only highlighted (+/-) lines rather than total body lines including context.

@barrettruth barrettruth force-pushed the feat/warn-max-lines branch 2 times, most recently from 64335a9 to a72fa29 Compare March 10, 2026 21:00
Problem: when a hunk's highlighted lines exceed `max_lines`, syntax
highlighting is silently skipped. Users have no indication why parts
of their diff lack highlighting.

Solution: add `highlights.warn_max_lines` (default `true`) that emits
a `vim.notify` warning with the hunk index and line count vs threshold.
Also change `max_lines` to count only highlighted (`+`/`-`) lines
rather than total body lines including context.
@barrettruth barrettruth force-pushed the feat/warn-max-lines branch from a72fa29 to 6e6f7e9 Compare March 10, 2026 21:32
@barrettruth barrettruth force-pushed the feat/warn-max-lines branch from 30c450f to 5015a5e Compare March 10, 2026 21:34
@barrettruth barrettruth merged commit de04381 into main Mar 10, 2026
7 checks passed
@barrettruth barrettruth deleted the feat/warn-max-lines branch March 10, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant