1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-25 09:43:21 +01:00

3 Commits

Author SHA1 Message Date
Eric Edem
805c329e5d fix: use text utils to move forward and backward by word (#2169)
* fix: don't check for adjacent void with modified move

This was causing a problem where when the current text was followed by a void node using a modifier key to move forward would force the selection to creep forward a character at a time.

With this change, now the modifier will move as expected, but will jump over void nodes. This is not ideal, but seems like a behavior that will be slightly better than the current one.

* fix: modified key movement.

Use TextUtils.getWordOffsetForward and TextUtils.getWordOffsetBackward to move around by words.

The idea now is that if you move forward or backward, it is completely controlled by slate instead of trying to rely on a combination of browser behavior and slate trying to stop the browser from doing something wrong. This makes things quite a bit more intuitive in the implementation, and gives us a bit more control.

* tests: a whole bunch of selection movement tests.

* tests: more movement tests.
2018-10-22 11:21:20 -07:00
Ian Storm Taylor
fd9243b8f5
refactor slate-hotkeys, fix deleting at start of block (#2048) 2018-08-07 15:58:33 -07:00
Justin Weiss
d4c630c05a Extract hotkey and environment detection into separate packages (#1760)
* Extract hotkey and environment detection into separate packages

Overriding default behavior in plugins can be hard, because you have
to match all of the keybindings that Slate uses. By exporting hotkeys
as its own package, both core Slate plugins and custom plugins can use
the same key detection logic.

* Rename Hotkeys.* to Hotkeys.is*
2018-04-27 13:19:39 -07:00