## Problem `highlights.context.enabled` and `highlights.context.lines` were defined, validated, and range-checked but never read during highlighting. Hunks inside incomplete constructs (e.g., a table literal or function body whose opening is beyond the hunk's own context lines) parsed incorrectly because treesitter had no surrounding code. ## Solution `compute_hunk_context` in `init.lua` reads the working tree file using the hunk's `@@ +start,count @@` line numbers to collect up to `lines` (default 25) surrounding code lines in each direction. Files are read once via `io.open` and cached across hunks in the same file. `highlight_treesitter` in `highlight.lua` accepts an optional context parameter that prepends/appends context lines to the parse string and offsets capture rows by the prefix count, so extmarks only land on actual hunk lines. Wired through `highlight_hunk` for the two code-language treesitter calls (not headers, not `highlight_text`, not vim syntax). Closes #148. |
||
|---|---|---|
| .. | ||
| commands.lua | ||
| conflict.lua | ||
| debug.lua | ||
| diff.lua | ||
| fugitive.lua | ||
| git.lua | ||
| health.lua | ||
| highlight.lua | ||
| init.lua | ||
| lib.lua | ||
| log.lua | ||
| merge.lua | ||
| parser.lua | ||