You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto scroll (scroll-sync) the discord preview with the editor.
Ie the preview scrolls to the information that is visible in the editor.
I've experimented with this quite a bit and also tried out some existing implementation.
None of the third-party scroll sync implementations I could find are suitable because they're all using a relative scroll sync.
This eventually misses information, especially for things like images and embeds where the height of the preview is very different from the editor.
What seems like the best solution is to assign the line as a div id for the Discord preview.
The editor can use cm.getViewport() to get the visible lines in the editor. The Discord preview then scrolls to the div with a ID that matches the top visible line.
The text was updated successfully, but these errors were encountered:
Auto scroll (scroll-sync) the discord preview with the editor.
Ie the preview scrolls to the information that is visible in the editor.
I've experimented with this quite a bit and also tried out some existing implementation.
None of the third-party scroll sync implementations I could find are suitable because they're all using a relative scroll sync.
This eventually misses information, especially for things like images and embeds where the height of the preview is very different from the editor.
What seems like the best solution is to assign the line as a
div
id for the Discord preview.The editor can use
cm.getViewport()
to get the visible lines in the editor. The Discord preview then scrolls to thediv
with a ID that matches the top visible line.The text was updated successfully, but these errors were encountered: