Repository navigation
Conversation
Diff previews can show old and new in two columns: deletions paired with the additions that follow them, each side with its own line numbers, row tint and word-level tint, long lines wrapping within their column. v toggles it and the choice is saved as diff_side_by_side for every later diff. Panes narrower than 60 columns fall back to the unified layout. Toggling keeps the reader's place by source line, like w. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wahajolla
marked this pull request as ready for review
October 16, 2026 18:45
5 tasks done
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.
What
Diff previews can be read side by side:
vswitches between the existing unified view and two columns, old on the left and new on the right. Deleted lines sit on the same row as the additions that replace them, each side keeps its own line numbers, row tint and word-level tint, and long lines wrap within their column (woff clips them instead). The choice is saved asdiff_side_by_sideand applies to every later diff. Panes narrower than 60 columns fall back to unified, and the footer saysv: side by side (too narrow).Why
Wide panes have room to read a change against what it replaced, the way VS Code's side-by-side diff does, and in a unified view a long run of deletions pushes the additions that replace them off screen.
How it fits in:
diffview::render_splitreuses the same parse, highlighting and word ranges asrender(now shared through onestyledpass, so unified output is unchanged and the existing diffview tests pass as before). It needs the pane width, so a diffDockeeps its rawgit difftext andrelayoutbuilds the split rows instead of callingbuild_rows;rows_keyincludes the layout. Rows are tagged with the unified line they start at, sovkeeps the reader's place throughpending_src, likew.git showpreviews stay unified.Overlap: like #80, #88, #99, #106 and #109, this adds a field to
Stateand its hand-writtenwrite_stateline, so whichever lands second needs a trivial rebase. No open PR usesvin the preview.Checklist
cargo build --releasesucceeds (run fromplugins/herdr-sidebar)cargo testpasses (add/adjust tests for behavior changes) — newside_by_side_pairs_old_and_new_lines,side_by_side_rows_fill_the_width_and_map_to_unified_lines,side_by_side_wraps_within_each_column,side_by_side_keeps_hunk_markers_and_plain_lines_full_width,diff_lays_out_side_by_side_when_toggled_and_wide_enough;state_roundtrip_and_forgiving_parsecovers the new field. Locally on macOS, 3 tests fail with and without this change because Apple Git 2.39 predatesgit checkout --end-of-options(checkout_branch_switches_without_forcing_dirty_work,create_branch_refuses_a_name_already_in_use,drawer_checkout_and_reset_arguments_work_in_a_real_repo); CI's git should be fine.cargo clippy --release -- -D warningsis cleanscripts, or persistence (see AGENTS.md "Plugin dev workflow") — macOS, herdr 0.8.2, linked checkout: a working-tree diff of a Go file rendered side by side with paired -/+ rows and a hunk marker,
vtoggled it and persisted the setting, and the footer showedv: side by side. Not tried on Windows or Linux.Draft until it has had some daily use.
🤖 Generated with Claude Code