You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Show git changes in a split (side-by-side) diff view in the editor #19208
#19204 (from #2846) adds Git change markers to the editor gutter, with a peek line widget showing the index version of a change and a Revert button. It does not offer a side-by-side view of the file.
It would be nice to be able to open a split diff for the current document: the index version of the file on one side (read-only) and the live, editable document on the other, with aligned lines, synchronized scrolling, and change highlighting on both sides -- like "Compare with index" in other editors.
Groundwork
The ext-diff.js module shipped with show git changes in the editor gutter #19204 contains Ace's full ace/ext/diff extension, including SplitDiffView, which drives two editors with aligned line numbers, synced scroll/wheel, and change highlighting. It accepts existing editors via diffModel.editorA / editorB.
The git_diff_base_contents RPC already returns the index version of the file in the document's encoding.
What is needed
A split mode that shows the index version in the secondary view, as a separate read-only session loaded with the base contents (the current split clones the same document, so both views edit the same buffer).
Attach SplitDiffView to the two editors, fed by the gutter module's debounced recompute, and tear it down when the split closes or the base is refreshed.
Check the editor options the view forces on both sides (e.g. customScrollbar, which RStudio does not otherwise enable), and the alignment line widgets' interaction with chunk output and MathJax widgets.
Activity
show git changes side by side in the editor (#19212)
git peek: pin to the editor's bottom edge for tall changes
git changes: previous/next and a change count in the status bar
git changes: fix go-to-change targets, the bar at a leading deletion,…
git changes: no change count for a failed diff; go to an added final …
git changes: keep the change in view as peeks move; open staged copies
git changes: unanimated scroll when a peek comes along; any newlines …
git changes: realign for lines unfolded on the way to a change
git changes: settle the layout before scrolling to a change; pin a to…
git changes: go to the first change the editor marks, from the Git pane
git changes: first-change follow-up after the gutter attaches and nav…
git changes: drop a stale first-change follow-up; Escape from the bas…
git changes: a deletion's side-by-side bar below the marked line; one…
git changes: keep a first-change follow-up across a new base; a chunk…
git changes: padding below chunk output onto the action bar after it
git changes: padding moving off the action bar never goes back onto it
git changes: fold bookkeeping for new padding alone
git change review: toolbar toggle, revert bar, pane headers, go-to-ch…