This means we have some duplicated values in different parts of the
tree, but it’s cleaner in the view since each component only consumes
a single object. Seems like the presenter should convey the correct
data to the correct locations and minimize the logic in the view. A
few duplicated integers is a reasonable trade-off.
The target of mousewheel events needs to be preserved when scrolling.
It used to be dealt with in the view, but now we can do it in the
presenter for a simpler view implementation.
This allows us to use the presenter for all stages of the component
lifecycle rather than needing to wait until it is created.
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This isn’t a super efficient approach, but it is simple and should be
correct. Once we move all state to the presenter we can perform a more
efficient synchronous update when markers change.
It contains the .scrollWidth and then all the lines in a nested .lines
object. The .width has been removed from each line and replaced with
.content.scrollWidth.
Removed shouldComponentUpdate because we will always update the
component manually once this is done, but I don’t want to accidentally
prevent the component from updating during the conversion process.
This commit has a failing spec due to the presenter not accounting for
individual character widths.
This adds an insertion point to the lines div via a <content> tag,
allowing immediate children of the editor tag to be positioned relative
to the lines div but still be styled via global CSS.
* Simplify scrollbar refresh and measurement by using imperative DOM
manipulation instead of React to hide/show scrollbars.
* Rename `::performInitialMeasurement` to `::becameVisible`
* Break `::checkForVisibilityChange` out of `::pollDOM` and use it in
to check for the element becoming visible in `componentWillUpdate`.
* Don't rely on stored visibility state anywhere. Always check again.
This could potentially be cached for an update cycle but being wrong
about this is disastrous so I'm being conservative.
This ensures lines have an opaque background that matches whatever the
editor is styled as, but avoids the need to apply the .editor-colors
class to the .lines div. That approach fell down when people were
setting the background color via means other than .editor-colors, such
as styling mini editors via the .editor.mini selector in the settings
view.