feat(inline): add view.inline.deletion_highlight option#144
feat(inline): add view.inline.deletion_highlight option#144dlyongemallo merged 1 commit intomainfrom
view.inline.deletion_highlight option#144Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new view.inline.full_width_deletions configuration option to improve the visual consistency of deletions rendered via virt_lines in the diff1_inline layout by padding deletions out to the window text width, and triggers repaint on resize so padding stays accurate.
Changes:
- Add optional padding of deleted
virt_linesininline_diff(full_width_deletions) using display width semantics (incl. tabs). - Add resize-driven repaints for active
diff1_inlinebuffers onWinResized/VimResized(gated by the option). - Add functional coverage for padding behavior and document the new option in
doc/diffview.txt.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lua/diffview/tests/functional/inline_diff_spec.lua | Adds functional specs verifying padding chunks, tab display width handling, multi-window behavior, and “no window” behavior. |
| lua/diffview/scene/layouts/diff_1_inline.lua | Registers a global resize autocmd that schedules per-buffer inline repaints when full_width_deletions is enabled. |
| lua/diffview/scene/inline_diff.lua | Implements widest-window text width detection and pads deletion virt_lines with same highlight group to span row width. |
| lua/diffview/config.lua | Introduces view.inline.full_width_deletions default + LuaLS type annotations. |
| doc/diffview.txt | Documents the new view.inline.full_width_deletions option and its behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
77f3dba to
11eede3
Compare
view.inline.full_width_deletions optionDiffDelete spans the row
11eede3 to
2514815
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2514815 to
ac03f37
Compare
DiffDelete spans the rowview.inline.deletion_highlight option
Configure the extent of the `DiffDelete` background on deleted virt_lines in the `diff1_inline` layout: `"text"` (default — just the deleted chars), `"full_width"` (pad to `min(&columns, 250)` so the highlight spans the row, matching `diff2_horizontal`'s native look), or `"hanging"` (skip the leading indent).
ac03f37 to
3679f3e
Compare
|
Hi @dlyongemallo, thanks for taking the time to make this better. Is there a reason why you are using virtual lines specifically? Virtual lines in neovim cannot be selected and copied in case one would like to do so (I don't know if it's my config only) and they also lose the tree-sitter highlights. Check the two examples below. One is using the virtual lines and the other is not. By the way, the virtual lines still do not reach the end of the line, they still get cut off. Would you still like for me to make a new issue about this? |
|
@charbelnicolas The reason The The inability to select/copy |
That makes a lot of sense, thanks for taking the time to reply, I appreciate it. Tree-sitter support and full line highlight should be enough, thank you! |


Configure the extent of the
DiffDeletebackground on deleted virt_lines in thediff1_inlinelayout:"text"(default — just the deleted chars),"full_width"(pad tomin(&columns, 250)so the highlight spans the row, matchingdiff2_horizontal's native look), or"hanging"(skip the leading indent).