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

Function hasSelections

lib/web/CodeMirror/test/multi_test.js:4–15  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

2 namespace = "multi_";
3
4 function hasSelections(cm) {
5 var sels = cm.listSelections();
6 var given = (arguments.length - 1) / 4;
7 if (sels.length != given)
8 throw new Failure("expected " + given + " selections, found " + sels.length);
9 for (var i = 0, p = 1; i < given; i++, p += 4) {
10 var anchor = Pos(arguments[p], arguments[p + 1]);
11 var head = Pos(arguments[p + 2], arguments[p + 3]);
12 eqCharPos(sels[i].anchor, anchor, "anchor of selection " + i);
13 eqCharPos(sels[i].head, head, "head of selection " + i);
14 }
15 }
16 function hasCursors(cm) {
17 var sels = cm.listSelections();
18 var given = (arguments.length - 1) / 2;

Callers 1

multi_test.jsFile · 0.85

Calls 2

eqCharPosFunction · 0.85
PosFunction · 0.50

Tested by

no test coverage detected