Skip to content

feat(diff): honor diffopt inline granularity - #433

Merged
barrettruth merged 1 commit into
mainfrom
feat/diffopt-inline-granularity
Aug 17, 2026
Merged

feat(diff): honor diffopt inline granularity#433
barrettruth merged 1 commit into
mainfrom
feat/diffopt-inline-granularity

Conversation

@barrettruth

Copy link
Copy Markdown
Owner

Problem

'diffopt' inline: decides how much of a changed line Neovim emphasizes, and
inline:char ships in the default. diffs.nvim ignored it, so its surfaces
disagreed with native diff windows and word-level emphasis was unreachable.

Solution

Resolve inline: with the other 'diffopt' facets and reshape intra-line spans
to it: none skips the work, simple spans first to last difference, char
is unchanged, word grows spans to word boundaries and merges gaps of five
bytes or less. A missing value resolves to simple, as Neovim does. The
existing OptionSet repaint carries it live, so no mapping or option is added.

## Problem

'diffopt' `inline:` decides how much of a changed line Neovim emphasizes, and
`inline:char` ships in the default. diffs.nvim ignored it, so its surfaces
disagreed with native diff windows and word-level emphasis was unreachable.

## Solution

Resolve `inline:` with the other 'diffopt' facets and reshape intra-line spans
to it: `none` skips the work, `simple` spans first to last difference, `char`
is unchanged, `word` grows spans to word boundaries and merges gaps of five
bytes or less. A missing value resolves to `simple`, as Neovim does. The
existing `OptionSet` repaint carries it live, so no mapping or option is added.
@barrettruth
barrettruth merged commit 9b3499d into main Aug 17, 2026
5 checks passed
@barrettruth
barrettruth deleted the feat/diffopt-inline-granularity branch August 17, 2026 10:20
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