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
Preserve scroll position when toggling markdown Rendered/Raw views
Toggling a markdown file between Rendered and Raw replaces the entire
pane (FileNotebookView <-> CodeView), so the new pane always started at
the top of the document. Capture the outgoing pane's vertical scroll as
a fraction of its scrollable range, carry it on the pane-replacement
events, and re-apply it after the new pane's content is laid out.
A fraction is used instead of a char-offset snapshot because the two
modes render different documents. Application is deferred through the
render model's element-update cycle (version- and viewport-gated),
since a freshly created pane has no laid-out content yet and applying
immediately would clamp the scroll to the top.
Fixes the scroll-preservation half of #7897; search/replace is out of
scope.
0 commit comments