Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scroll don't sync? #4

Closed
masakichi opened this issue Jun 24, 2014 · 8 comments
Closed

scroll don't sync? #4

masakichi opened this issue Jun 24, 2014 · 8 comments

Comments

@masakichi
Copy link

scroll the source file part(left) the preview part(right) will scroll.
but scroll the preview part the source file part dont move.

@uranusjr
Copy link
Member

This is actually deliberate. Most Markdown editors with scrolling sync do it this way, including:

The only editor I know of that does it both ways is StackEdit.[1] I’m not sure why this is the case, but I can image there might be some tricky problems when both scrollers need to sync, causing some kind of dead locks.

The bottom line is, I don’t really see the point of syncing the editor when the preview scrolls. It is obviously useful to sync the preview because you can see the updates when you enter things in the editor, but the other way around doesn’t seem that useful at all.

I would consider implementing this if there are cases in which this might be useful, though.

[1] StackEdit actually does it in a cool way. My guess is that they utilise the parser’s source map. I don’t currently plan to look into this though, since it’ll take much time.

@masakichi
Copy link
Author

Maybe you are right.

But, I think it is not only a editor but also a reader, both editor and proof reader will use your App. If so what I said will make sense.

@uranusjr
Copy link
Member

I would imagine that editors usually just read the rendered HTML and wouldn’t edit the Markdown source themselves. Might not be the case though, I’ve never worked in related areas.

This is still an interesting idea though. I would still consider implementing it, especially something like what StackEdit does. I’m closing this now, but I might revisit the idea if there’s time.

@tmikaeld
Copy link

I went here to comment on the scrolling - see, when images are rendered, you won't see the text you write beneath them because the text will be below the images on the right side.

I'd suggest adding line-change detection, so that when a line get changed it will auto-scroll to that position instead of relying on sync scroll only.

@madranet
Copy link

@uranusjr: The bottom line is, I don’t really see the point of syncing the editor when the preview scrolls...

I do.

When I've written a longish piece and am proof-reading it, I'll proof-read it in the preview window. Then, if I spot a typo or other error, I'll want to jump back to the edit window to fix it. If sync'd scrolling worked in both directions, this would be easy. As it is, I have to hunt through the edit window to find the offending markdown for correcting.

FranklinYu pushed a commit that referenced this issue Dec 20, 2020
@OuttaSpaceTime
Copy link

still looking for this in 2021 ;) It would be nice if one could at least click "jump to preview position" in editor. I use markdown for summaries on studies and it is really awful to scroll through large summaries or find a certain position where I would like to continue working on.

@ychoi
Copy link

ychoi commented Mar 5, 2021

still looking for this in 2021 ;) It would be nice if one could at least click "jump to preview position" in editor. I use markdown for summaries on studies and it is really awful to scroll through large summaries or find a certain position where I would like to continue working on.

Same here.

@cskeeters
Copy link

I just checked out Dillinger, and when you activate the Scroll Sync in settings, it syncs the preview when you scroll the source and the source when you scroll the preview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants