Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Preserve markdown view position when toggling modes#3794

Open
shriram-svg wants to merge 1 commit into
BoostIO:masterfrom
shriram-svg:fix-2563-preserve-view-position
Open

Preserve markdown view position when toggling modes#3794
shriram-svg wants to merge 1 commit into
BoostIO:masterfrom
shriram-svg:fix-2563-preserve-view-position

Conversation

@shriram-svg
Copy link
Copy Markdown

Fixes #2563.

Summary

  • Capture the current CodeMirror cursor/scroll and preview scroll before switching markdown editor modes.
  • Restore that view state after moving between split and editor/preview modes, guarded by note key so new notes still open from the top.
  • Preserve split-mode scroll sync state while restoring positions so the restore does not trigger a sync jump.

Verification

  • git diff --check
  • eslint browser/components/MarkdownEditor.js browser/components/MarkdownSplitEditor.js browser/main/Detail/MarkdownNoteDetail.js --rule "react/no-unknown-property: off" using existing BoostNote node_modules from a sibling worktree. The rule override avoids existing false positives for CSSModules styleName props.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Toggle view mode resets cursor location in note

2 participants