feat(config): allow diff1_plain layout in standard diff views#8
feat(config): allow diff1_plain layout in standard diff views#8dlyongemallo merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates Diffview’s config validation to allow the diff1_plain layout in “standard” view layout settings.
Changes:
- Add
"diff1_plain"to the list of validstandard_layoutsused for validatingview.default.layoutandview.file_history.layout.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| local view = M._config.view | ||
| local standard_layouts = { "diff2_horizontal", "diff2_vertical", -1 } | ||
| local standard_layouts = { "diff1_plain", "diff2_horizontal", "diff2_vertical", -1 } | ||
| local merge_layuots = { | ||
| "diff1_plain", | ||
| "diff3_horizontal", |
There was a problem hiding this comment.
By adding "diff1_plain" to standard_layouts, this also implicitly allows view.file_history.layout = "diff1_plain" (since valid_layouts.file_history = standard_layouts). The file-history view has code paths that assume a Diff2 layout (e.g. scene/views/file_history/listeners.lua:open_in_diffview accesses layout.a.file.rev), which will error for Diff1 layouts that only have b. Consider either (a) keeping file_history restricted to Diff2 layouts, or (b) updating file-history actions to handle Diff1 (or to disable/guard actions that require both a and b).
| local standard_layouts = { "diff1_plain", "diff2_horizontal", "diff2_vertical", -1 } | ||
| local merge_layuots = { |
There was a problem hiding this comment.
Nit: merge_layuots looks like a typo ("layuots" vs "layouts"). Since this validation block is being touched, consider renaming it to merge_layouts to avoid propagating the misspelling.
No description provided.