this keeps track of whether the selection and the textarea
have to be updated, so that this logic isn't scattered
through the code, and to prevent superfluous updates
when holding shift, with an inverted selection present, and pressing
a cursor-movement key, the editor now collapses the selection to its
start, and then cleverly interprets the resulting selection (after
the movement) to determine how to extend its own selection
all this to work around the fact that we can't set an inverted
selection in a textfield.
the editor automatically extends its set of cursor-movement key
combos when such a key is pressed, to handle user keybindings