Scroll to line on webpage if out of view
Closed this issue · 1 comments
robherley commented
What is the feature or enhancement?
If you have a really long snippet and line(s) are selected, the page should jump to those lines.
Could use getSelectedLines
somewhere after the other methods get called when the DOM loads:
snips.sh/web/static/js/snips.js
Lines 103 to 112 in 8e52e02
Something like this should work with better checks:
document.getElementById(`#L${theFirstSelectedLineHere}`).scrollIntoView();
Or if the menu/etc get in the way window.scroll
to the element's bounding +/- some px should also work
robherley commented
Thanks @fabricionaweb 🎉