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

fix #5280: synchronize preview with editor when scrolls #5442

Conversation

a1994846931931
Copy link
Contributor

Signed-off-by: Cai Xuye a1994846931931@gmail.com

Synchronize markdown preview with editor when scrolls on both sides.

Before:
fix-markdown-preview-1

After:
fix-markdown-preview-2

@akosyakov
Copy link
Member

@AlexTugarev Could you review please?

Copy link
Contributor

@svenefftinge svenefftinge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thank you!

@a1994846931931 a1994846931931 force-pushed the fix-markdown-preview-synchronization branch from 71ba5ff to 25c9be0 Compare June 14, 2019 02:55
@a1994846931931
Copy link
Contributor Author

@AlexTugarev I found another related issue - synchronization may break if the preview is quickly scrolled all the way up to the top. But it seems that it already exists on the current master. I think it's better to open a new issue on this. Also, the performance of finding the source code line could be improved.

fix-markdown-preview-2-break3

@AlexTugarev
Copy link
Contributor

AlexTugarev commented Jun 14, 2019

looks nice! reviewing right now...

simple example ✅

2019-06-14 08 05 29

Copy link
Contributor

@AlexTugarev AlexTugarev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@a1994846931931 thanks for this PR! Very cool! It's a great improvement. 💯

⚠️ Please apply the requested changes to the implementation of getVisibleRanges.

Also, as you pointed out correctly, the sync story needs a second revision to get rid of this nasty setTimeout-based locks/unlocks.

Signed-off-by: Cai Xuye <a1994846931931@gmail.com>
@a1994846931931
Copy link
Contributor Author

Also, as you pointed out correctly, the sync story needs a second revision to get rid of this nasty setTimeout-based locks/unlocks.

Yes, indeed

@a1994846931931 a1994846931931 force-pushed the fix-markdown-preview-synchronization branch from 25c9be0 to c58e8b8 Compare June 14, 2019 08:14
@a1994846931931
Copy link
Contributor Author

⚠️ Please apply the requested changes to the implementation of getVisibleRanges.

@AlexTugarev Thanks for your detailed review! Codes are updated now.

@AlexTugarev AlexTugarev merged commit f1c23e2 into eclipse-theia:master Jun 14, 2019
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.

None yet

4 participants