When the cursor is positioned before a character, we always make it the
width of that character. But at the end of a line, there is no character
to use to set the width, so we just use the defaultCharWidth.
This makes the block cursor visible on empty lines in vim-mode.
Previously, SelectionsComponenet::shouldComponentUpdate was storing the
ranges for selections as a side effect. We also were passing boolean
values (cursorMoved and selectionUpdated) to determine if these
components should update.
Now, we compute a simple hash of screen ranges for selections and
cursors in the root component and pass them down. This simplifies
shouldComponentUpdate for selections and allows us to implement one
for cursors.
This fork of React allows data-react-skip-selection-restoration to be
defined on input elements, skipping costly selection restoration that
occurs when the input element is focused during reconciliation.