MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / equals

Method equals

lib/web/CodeMirror/src/model/selection.js:17–25  ·  view source on GitHub ↗
(other)

Source from the content-addressed store, hash-verified

15 primary() { return this.ranges[this.primIndex] }
16
17 equals(other) {
18 if (other == this) return true
19 if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) return false
20 for (let i = 0; i < this.ranges.length; i++) {
21 let here = this.ranges[i], there = other.ranges[i]
22 if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) return false
23 }
24 return true
25 }
26
27 deepCopy() {
28 let out = []

Callers 6

pushSelectionToHistoryFunction · 0.45
setSelectionInnerFunction · 0.45
makeChangeFromHistoryFunction · 0.45
pushSelectionToHistoryFunction · 0.45
setSelectionInnerFunction · 0.45
makeChangeFromHistoryFunction · 0.45

Calls 1

equalCursorPosFunction · 0.90

Tested by

no test coverage detected