When scrolling via the model layer, such as happens on autoscroll due to
moving the cursor, we update the scroll position of the fake vertical
scrollbar manually. When we receive the scroll event that results from
this, we want to do nothing. The best way to determine whether we're
getting a "real" scroll event from the user or feedback from setting
the scrollTop ourselves is to compare the scrollTop to what's in the
model. If the values are equal, there's no need to request an animation
frame to assign it. This improves performance.
Previously, the overlayer served as a permanent target for mousewheel
events that would never be removed by scrolling. This is because the
velocity scrolling effect on a trackpad is implemented by repeating
events on the original mousewheel event target. If this target is
removed, the events stop repeating and the velocity effect is ruined.
Now we refrain from removing any lines until mousewheel events stop
flowing.
This bakes character width tracking into display buffer directly, which
moves us toward a world where all rendering decisions can be made in the
model to strictly control DOM reads.
The overlayer is absolutely positioned to exactly fill the scroll-view.
If we can retain this strategy and never give the input a position that
exceeds the bounds of the overlayer, we can guarantee that it never
forces the scroll position of the scroll view to change when it is
focused due to the browsers default behavior.
The space-pen view is now a simple wrapper around the entire React
component to integrate it cleanly into our existing system. React
components can't adopt existing DOM nodes, otherwise I would just have
the react component take over the entire view instead of wrapping.