[stacked] Preserve rail style in generated buffers and reloads #157

Closed
opened 2026-09-21 18:12:36 +00:00 by barrettruth · 0 comments
Owner

Original issue: barrettruth/diffs.nvim#363
Original author: barrettruth
Original date: 2026-05-28T02:57:37Z

Part of #358.

Goal

Persist generated-buffer rail style so stacked buffers remain stacked across refresh and :edit reloads.

Scope

  • Store a generated buffer rail style, for example b:diffs_rail_style = 'dual'|'single', alongside existing rail width vars.
  • Add a helper to read the buffer rail style with dual as the compatibility default.
  • Extend generated buffer creation to accept a rail style and pass it to rail annotation.
  • Extend generated buffer replacement/reload to preserve the existing buffer rail style when no explicit override is supplied.
  • Ensure generated hunk action metadata is still parsed from raw diff lines, not rail-prefixed display lines.

Non-goals

  • Do not introduce a public config option.
  • Do not store rail style in source metadata unless the implementation needs it for reliable reloads.
  • Do not alter default unified buffers.

Acceptance criteria

  • Generated buffers carry rail width, separator width, and style metadata.
  • Replacing generated diff lines preserves single rail style when the buffer was created as single rail.
  • commands.read_buffer() / :edit reload does not revert stacked buffers back to dual rails.
  • Raw hunk metadata remains rail-free and usable for hunk actions.
> Original issue: barrettruth/diffs.nvim#363 > Original author: `barrettruth` > Original date: 2026-05-28T02:57:37Z Part of #358. ## Goal Persist generated-buffer rail style so stacked buffers remain stacked across refresh and `:edit` reloads. ## Scope - Store a generated buffer rail style, for example `b:diffs_rail_style = 'dual'|'single'`, alongside existing rail width vars. - Add a helper to read the buffer rail style with `dual` as the compatibility default. - Extend generated buffer creation to accept a rail style and pass it to rail annotation. - Extend generated buffer replacement/reload to preserve the existing buffer rail style when no explicit override is supplied. - Ensure generated hunk action metadata is still parsed from raw diff lines, not rail-prefixed display lines. ## Non-goals - Do not introduce a public config option. - Do not store rail style in source metadata unless the implementation needs it for reliable reloads. - Do not alter default unified buffers. ## Acceptance criteria - Generated buffers carry rail width, separator width, and style metadata. - Replacing generated diff lines preserves single rail style when the buffer was created as single rail. - `commands.read_buffer()` / `:edit` reload does not revert stacked buffers back to dual rails. - Raw hunk metadata remains rail-free and usable for hunk actions.
barrettruth 2026-09-21 18:12:36 +00:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
barrettruth/diffs.nvim#157
No description provided.