SublimeElmLanguageSupport icon indicating copy to clipboard operation
SublimeElmLanguageSupport copied to clipboard

A hacky 'fix' for the scrolling bug - better'n'nothin'?

Open colinta opened this issue 5 years ago • 1 comments

Addresses #65. After running the 'elm-format' command, a timeout function scrolls to the previous viewport location, nothing more than that! I played with the timeout value until it consistently restored the scroll position.

Improvements: The viewport doesn't always scroll to the top, so a check of viewport_position would help, but in my testing if the viewport didn't scroll this plugin didn't really have much effect.

I didn't see any "on scroll" event on EventListener or ViewEventListener, but another improvement would be a series of short timeouts, ~100ms, until a max timeout is reached (700-1000ms), and each timeout would check the position. That would restore the position as quickly as possible. But "perfect" is the enemy of "done" and I wanted to be done. 😉

colinta avatar Apr 11 '19 14:04 colinta