-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SelectionChangeObserver, use it for editor.range updates
SelectionChangeObserver maintains a singleton instance that polls the window using `requestAnimationFrame` for changes to the selection. Editors' EventManager instances use a SelectionManager to listen for `selectionchanged` events, and update the editor's `range` if necessary. Removes code that would use some keyup events (when `key.isMovement()`) and `mouseup` events to detect when the range could have changed. The range-detection code was previously spread out over `EventManager`, `Editor`, `Cursor` and `EditState`. This code change consolidates most of the responsibility for knowing/reading/updating the editor's `range` o its `EditState` instance. The editor now delegates `range` to the edit state instance, and the edit state instance is responsible for knowing when the editor's inputMode or range has changed. Some tests assumed selection changes would be picked up synchronously; for those tests a `Helpers.wait` helper is added that schedules a callback with `requestAnimationFrame`. Also: * use "hidepassed" for sauce tests to improve test failure debugging * remove unused `editor.selectSections` * remove now-unnecessary key commands for meta+arrow on mac
- Loading branch information
Showing
34 changed files
with
565 additions
and
489 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.