MCPcopy Create free account
hub / github.com/editablejs/editable / getVoidPoint

Function getVoidPoint

packages/models/src/transforms/move.ts:5–18  ·  view source on GitHub ↗
(editor: Editor, point: Point, reverse: boolean)

Source from the content-addressed store, hash-verified

3import { Editor } from '../interfaces/editor'
4
5const 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
20export const move = (editor: Editor, options: SelectionMoveOptions = {}) => {
21 const { selection } = editor

Callers 1

moveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…