Commit 288c9bf
refactor(diff): rename diff_opts.layout "inline" to "unified" (#295)
## Summary
Renames the `diff_opts.layout = "inline"` option (added in #195, queued
for v0.4.0 via release-please #279) to **`"unified"`**, before it ships
in a tagged release. Tracked in #293.
[@wookayin pointed
out](#195 (comment))
that the shipped `"inline"` mode isn't a true "inline" diff in the VS
Code sense — it renders a unified diff in a separate `rightbelow vsplit`
pane, not an in-place virtual-text overlay in the same window. Naming it
`"inline"` now would force a breaking rename later, once we add the real
in-place overlay (the mode that most deserves the name `"inline"`).
Renaming is free now (not yet released) and a breaking change after #279
merges.
## What changed
- **Config value** `"inline"` → `"unified"`: validation + error message
(`config.lua`), the `ClaudeCodeDiffLayout` type alias (`types.lua`), all
four dispatch sites (`diff.lua`), and the stored `layout` value
(`diff_inline.lua`).
- **User-facing buffer name**: `<file> (inline diff)` → `<file> (unified
diff)`.
- **Docs**: README layout enum + label; a `CHANGELOG.md` `[Unreleased]`
entry for `layout = "unified"`.
- **Tests**: the accept test now expects `"unified"`; a new test asserts
the former `"inline"` is rejected.
## Decisions
- **No deprecated alias.** `"inline"` was never in a tagged release, so
there's no backward-compat obligation, and rejecting it cleanly reserves
the name for the future in-place overlay (#294). The validation error
names `'unified'`, so anyone tracking `main` is pointed at the new
value.
- **Internal names kept.** The `diff_inline.lua` module, its functions,
the `claudecode_inline_diff` buffer variable, and the
`ClaudeCodeInlineDiff*` highlight groups are unchanged — they describe
the inline-*style* rendering, not the layout value (#293 noted the
buffer var can stay). This keeps the diff small and low-risk.
- **#279 changelog** regenerates from commits via Communique on the next
push to `main`, so the v0.4.0 entry reflects "unified" automatically; I
did not hand-edit the bot branch.
## Validation
- `mise run all`: treefmt clean, luacheck **0/0**, **703/703** tests
pass (baseline 702 + the new rejection test).
- Headless Neovim smoke test: `layout = "unified"` accepted, `"inline"`
rejected (error names `'unified'`), `"vertical"` still works.
The true in-place overlay (the future `"inline"`) is tracked in #294.
Refs #293, #195, #82
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Signed-off-by: Thomas Kosiewski <tk@coder.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 5a04f8b commit 288c9bf
7 files changed
Lines changed: 47 additions & 20 deletions
File tree
- lua/claudecode
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
380 | | - | |
| 379 | + | |
| 380 | + | |
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
| 135 | + | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
838 | 838 | | |
839 | 839 | | |
840 | 840 | | |
841 | | - | |
842 | | - | |
| 841 | + | |
| 842 | + | |
843 | 843 | | |
844 | 844 | | |
845 | 845 | | |
| |||
932 | 932 | | |
933 | 933 | | |
934 | 934 | | |
935 | | - | |
936 | | - | |
| 935 | + | |
| 936 | + | |
937 | 937 | | |
938 | 938 | | |
939 | 939 | | |
| |||
1166 | 1166 | | |
1167 | 1167 | | |
1168 | 1168 | | |
1169 | | - | |
1170 | | - | |
| 1169 | + | |
| 1170 | + | |
1171 | 1171 | | |
1172 | 1172 | | |
1173 | 1173 | | |
| |||
1315 | 1315 | | |
1316 | 1316 | | |
1317 | 1317 | | |
1318 | | - | |
1319 | | - | |
| 1318 | + | |
| 1319 | + | |
1320 | 1320 | | |
1321 | 1321 | | |
1322 | 1322 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
| 333 | + | |
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
348 | | - | |
| 348 | + | |
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
| 330 | + | |
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
350 | | - | |
351 | | - | |
| 350 | + | |
| 351 | + | |
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
378 | 404 | | |
379 | 405 | | |
380 | 406 | | |
| |||
0 commit comments