-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Sync Split Editor scroll position #1521
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
Conversation
|
You can probably bind the scroll of one pane directly to the other by removing the debounce and removing the easing, but since these events are fired per (sub)pixel movement, you can rank up 1000+ events per second on a UHD screen and it didn't seem sane to do so. Feel free to improve or like it as is. |
sosukesuzuki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks your for great contribution.
please confirm my review.:pray:
| let f, t | ||
| const timer = setInterval(() => { | ||
| t = (s - i) / s | ||
| f = t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want you to rename variables.
Because, it is difficult to understand meaning of s, t, f for me.
And, please refactor for conditional operator, like below.
f = t < 0.5
? 2 * t * t
: -1 + (4 - 2 * t) * t
|
@sosukesuzuki Thanks for the review. I will address the issues, hopefully before or in the weekend. |
436b6a8 to
051ccad
Compare
|
@sosukesuzuki Fixed and rebased. Ready when you are. |
Forgot curly brace when merging master
|
Merged |
|
Apparently this in in 0.10.0 but not working for me. Does it have to be enabled somehow? |
|
@gramster Hmm.. there was a problem while merging lots of PRs. Could you create an issue about this? |
|
I noticed it does work from preview window (markdown syncs), but not from markdown window (preview doesn't sync). |
|
NOOB HERE |
|
@nototono Scroll syncing has a bug now. It will be fixed soon. |
I have created a low impact delayed debounced scroll sync for the split editor.
This could probably be done better with some modules that allow queueing and animation in order to better catch missed events from rapid scrolling, but I know absolutely nothing about react, so I coded this moon-lander-style. That said, it's already infinitely better than nothing.
This would close #1355.