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

Function areRangesSameLine

packages/editor/src/utils/lines.ts:14–19  ·  view source on GitHub ↗
(editor: Editable, range1: Range, range2: Range)

Source from the content-addressed store, hash-verified

12}
13
14const areRangesSameLine = (editor: Editable, range1: Range, range2: Range) => {
15 const rect1 = Editable.toDOMRange(editor, range1).getBoundingClientRect()
16 const rect2 = Editable.toDOMRange(editor, range2).getBoundingClientRect()
17
18 return doRectsIntersect(rect1, rect2) && doRectsIntersect(rect2, rect1)
19}
20
21/**
22 * A helper utility that returns the end portion of a `Range`

Callers 1

findCurrentLineRangeFunction · 0.85

Calls 1

doRectsIntersectFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…