RickStrahl / MarkdownMonster

An extensible Markdown Editor, Viewer and Weblog Publisher for Windows
https://markdownmonster.west-wind.com
Other
1.59k stars 236 forks source link

Cursor jumps with scroll sync set and preview closed #1104

Closed internationils closed 6 months ago

internationils commented 6 months ago

I have scroll sync set to "Editor and preview" and when the preview is hidden the cursor still jumps around in the MD. When I set sync to "none" it works normally. The sync should not take place when the preview is not active.

RickStrahl commented 6 months ago

Took a look and yes this behavior is inconsistent. It actually works, but the change of state - window visible and window update modes - are not reflected unless the previewer document reloads.

I've updated the code so that the state is checked on every refresh. Now hiding the preview or setting the sync mode to editor -> Preview should stop refreshing the editor - or turn it back on - in real time.

The jumpiness can occur if there are large blocks of code or large images that are larger than a single page - the editor has no way to match the code/image/media and so any tiny movement can jump to either end. This especially problematic at the top or bottom of the document. If you run into this the way around this is to use Editor->Preview instead of Preview and Editor sync mode. Preview off or None for sync mode works too, but that's the drastic option :smile:

It'll be in the next update.