(editor: Editor, point: Point, reverse: boolean)
| 3 | import { Editor } from '../interfaces/editor' |
| 4 | |
| 5 | const getVoidPoint = (editor: Editor, point: Point, reverse: boolean) => { |
| 6 | const voidElement = Editor.above(editor, { |
| 7 | at: point, |
| 8 | match: n => Editor.isVoid(editor, n), |
| 9 | }) |
| 10 | if (voidElement && !editor.isSolidVoid(voidElement[0])) { |
| 11 | const path = voidElement[1] |
| 12 | const p = reverse ? Path.previous(path) : Path.next(path) |
| 13 | return Editor.point(editor, p, { |
| 14 | edge: reverse ? 'end' : 'start', |
| 15 | }) |
| 16 | } |
| 17 | return point |
| 18 | } |
| 19 | |
| 20 | export const move = (editor: Editor, options: SelectionMoveOptions = {}) => { |
| 21 | const { selection } = editor |
no outgoing calls
no test coverage detected
searching dependent graphs…