A click on the outline in split view moves the editor too - #748
Merged
Conversation
…oo (#744) The outline's jump handed the source line to the editor only under isEditing. Split view entered from reading mode is isSplit alone, so the preview scrolled and the editor beside it stayed put. One derived flag, hasEditorPane, now answers "is there an editor on screen" for the jump and for the three places that already spelled out isEditing || isSplit.
This was referenced Sep 2, 2026
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 this is
The first half of #744: in split view a click on an outline entry scrolled the preview and left the editor beside it where it was. Plus two follow-ups found while testing that on a build. Not closing the issue — see Scope for what is left of it.
Mechanism
The jump. It has existed since 2.6.3 and hands the entry's source line to
editorPane.revealHeader, but only underisEditing. The two tab flags are independent: split view entered from reading mode isisSplitalone,isEditingstays false. The editor pane itself renders onisEditing || isSplit, so the component answered "is there an editor on screen" one way for drawing the pane and another way for using it. One derived flag,hasEditorPane, now answers it for the jump and for the three sites that already spelled outisEditing || isSplit.Where it lands. The preview puts the clicked heading just under its top edge; the editor centred it. With scroll sync off the two panes showed different places (with it on, the editor's scroll then dragged the preview into agreement, which is why it looked fine there). The editor now reveals the heading near its top too (
revealLineNearTop). The context menu's Edit keeps centring.Following the editor. The outline was one entry behind whenever a heading was the first line on screen: it was handed Monaco's top line, the one the viewport cuts in half. It now gets the line the tab records as its reading position, through
tabAnchorForEditorTopLine— the one crossing from a Monaco top line into the outline's numbering, the same oneeditorReadingPositionuses. The preview side already fed the outline from its anchor line; now both panes do.Scope
The second half of the report, "scrolling the editor does not move the outline highlight", was checked on a build and is not broken: the highlight follows the editor's scroll with sync off and on. It follows the scroll position, not the caret — moving the caret without scrolling does not change it — which may be what was observed. Not changed here.
At the exact boundary the two panes can disagree by one entry (the preview's anchor is 60px down, the editor's is two lines down); whichever scrolled last wins. Inherent to two anchors, unchanged.
No new runnable test: the gate and the reveal live in components with no seam. The existing source assertions in
jumpToSelectedFragment.test.tsandtocFollowsEditor.test.tsare updated to the new contract, and the latter's conversion fixture now pins the anchor-line case (top line one short of a heading → the heading's entry).Verification
On a build, driven by script: reading mode → split → click entry: editor at the heading (selected, five lines from the top), preview at the heading, sync off and on. Editor wheel-scroll with sync off: outline follows while the preview stays. Caret walked across a heading without scrolling: outline unchanged. Click then scroll: outline settles on the final position.