-
Notifications
You must be signed in to change notification settings - Fork 645
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
chained scrollbars #4
Comments
👍 this is something I'd really like to do but I haven't yet figured out exactly the best way to do it yet. Definitely on the todo list though |
Idea:
That gets you a height in lines to scroll on the code editor, to a height of the block element on the rendered pane. I don't know what to do from there. This is a really complex feature. |
I was attempting to do this yesterday, although each implementation I tried didn't quite work right. I have seen chained scroll-bars elsewhere so may have a go at reverse engineering how they went about it to learn how it can be done here. |
The simplest and most naïve way of implementing chaining would just be to link the %age scroll depth between the two views. Problem is that can go wrong when the markdown input is particularly smaller or larger than the output (eg a large image only takes up one line of input, but could be several hundred px high in the output). The way some editors achieve it is to break the markdown into sections, but I haven't yet figured out a foolproof way to do this that wouldn't completely break in some scenarios (you can't go and stick Totally open to pull requests if someone cleverer than me can figure it out. Otherwise I'll carry on experimenting but I can't promise when I'll be able to get it to work. Actually thinking about it, it might be possible to do something now that I've switched from marked to markdown-it, because it does give some information about source line numbers, and then could try and implement the solution suggested above... |
I ask that chained scrollbars be toggleable, just in case that wan't thought of |
Yeah good shout - I think that however they're implemented there's always scenarios where it'll be annoying, so definitely having a way to turn it off is a good idea |
Hi,
this is the best markdown editor, that i view. i have only one comment. is it possible chain scrollbars for automatic move preview down if i write?
thanks
Ondrej Sika
The text was updated successfully, but these errors were encountered: