feat(view)!: replace single_pane_for_one_sided with one_sided_layout#199
Merged
Conversation
Boolean becomes value-typed (`"default"` | `"raw"`, default `"default"`). `"raw"` now also substitutes `Diff1Raw` for `diff1_plain` bases, not just `Diff2`. `diff1_inline` is still skipped. No migration; the old key is dropped outright.
There was a problem hiding this comment.
Pull request overview
This PR replaces the boolean config view.single_pane_for_one_sided with a value-typed view.one_sided_layout ("default" | "raw") to control how one-sided diffs (A/?/D) are rendered, extending the “raw/plain buffer” behavior to Diff1 bases (while still skipping diff1_inline).
Changes:
- Introduces
view.one_sided_layoutconfig option with schema/type/docs updates and runtime validation. - Updates
FileEntry.with_layoutlayout selection to substituteDiff1Rawfor one-sided entries whenone_sided_layout = "raw"(including Diff1 bases; excludingdiff1_inline). - Refreshes functional tests and help docs to match the new option and behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lua/diffview/tests/functional/one_sided_layout_spec.lua | Updates/extends functional coverage for the new view.one_sided_layout behavior and Diff1/Diff2 substitution rules. |
| lua/diffview/scene/layouts/diff_1_raw.lua | Updates layout documentation to reference the new config key/value. |
| lua/diffview/scene/file_entry.lua | Adjusts effective layout selection logic to use one_sided_layout and to exclude diff1_inline. |
| lua/diffview/config.lua | Replaces config schema/type/docs for the new option and adds setup-time validation. |
| doc/diffview.txt | Replaces the help section for the old boolean key with the new enum option and updated semantics. |
| doc/diffview_defaults.txt | Updates documented defaults to reflect one_sided_layout. |
Comments suppressed due to low confidence (1)
lua/diffview/tests/functional/one_sided_layout_spec.lua:64
- The new
view.one_sided_layoutvalidation path (invalid value -> error + fallback to default) isn’t covered by this spec. Adding a small test case here (e.g. setone_sided_layout = "bogus"and assert it resets to "default") would help prevent regressions in the config schema behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Boolean becomes value-typed (
"default"|"raw", default"default")."raw"now also substitutesDiff1Rawfordiff1_plainbases, not justDiff2.diff1_inlineis still skipped.No migration; the old key is dropped outright.
Closes #184.