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

[WIP] Chained scrollbars #31

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

[WIP] Chained scrollbars #31

wants to merge 3 commits into from

Conversation

jbt
Copy link
Owner

@jbt jbt commented Jun 6, 2015

Ok this isn't quite complete, but here's my initial stab at implementing chained scrollbars - for #4.

So the way I've currently bashed it is as suggested in that issue - use the markdown parser to attribute source lines to elements in the output.

Then, when you scroll, down, it'll look and see how far down you've scrolled down as a %age of viewport height, find what element's at that position in the view, and try and align the corresponding input line / output element to the same Y position.

Kinda hard to explain. Currently I've left some helper elements in for the time being to see what's going on. Basically whatever's under the red line in each view should correspond. The line moves so that when you're at the very top, both views are scrolled to the top, and when you're at the very end, both views are at the end.

If anyone has any thoughts on this then do let me know, otherwise I'll just keep experimenting to see if I can make this as smooth as possible (and also have a way of disabling it, as suggested in the issue) because it definitely won't be able to get everything right.

@michaelboke
Copy link

nice,
Still some strange jumping arround when you edit and have a large amount of text with some whitespace/newlines between them.

Maybe a idea to jump to the line you're editing and than disable the scrolling for the time beeeing until you move to an other line. Any progress on this issue.

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

Successfully merging this pull request may close these issues.

2 participants