You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a reaction which has correct the caret position if the user has moved the caret into a region of the document which is supposed to be currently hidden. For this, I search the changeList for a SelectionChangeEvent of type SelectionChangeType.pushCaret. This works for simple upstream/downstream movement of the caret by pressing left or right arrows. However, when the user presses up or down buttons, the current implementation in CommonEditorOperations.moveCaretUp and moveCaretDown will instead produce a SelectionChangeType.collapseSelection, even when the selection was already collapsed before. Maybe I misunderstood the change types, but to me this naming is confusing.
I would expect moveCaretUp and moveCaretDown to fire an event of collapseSelection when there actually was an expanded selection before, else fire an event of pushCaret. If pushCaret for some reason was meant for one-step only movements, I'd rather expect another type of moveCaret.
I can work around this by reacting to collapseSelection as well; I still think this is confusing.