MCPcopy Index your code
hub / github.com/csev/py4e / skipAtomicInSelection

Function skipAtomicInSelection

tools/pythonauto/static/codemirrorepl/codemirror.js:1157–1169  ·  view source on GitHub ↗
(doc, sel, bias, mayClear)

Source from the content-addressed store, hash-verified

1155 // Return a selection that does not partially select any atomic
1156 // ranges.
1157 function skipAtomicInSelection(doc, sel, bias, mayClear) {
1158 var out;
1159 for (var i = 0; i < sel.ranges.length; i++) {
1160 var range = sel.ranges[i];
1161 var newAnchor = skipAtomic(doc, range.anchor, bias, mayClear);
1162 var newHead = skipAtomic(doc, range.head, bias, mayClear);
1163 if (out || newAnchor != range.anchor || newHead != range.head) {
1164 if (!out) out = sel.ranges.slice(0, i);
1165 out[i] = new Range(newAnchor, newHead);
1166 }
1167 }
1168 return out ? normalizeSelection(out, sel.primIndex) : sel;
1169 }
1170
1171 // Ensure a given position is not inside an atomic range.
1172 function skipAtomic(doc, pos, bias, mayClear) {

Callers 2

setSelectionNoUndoFunction · 0.85
reCheckSelectionFunction · 0.85

Calls 3

normalizeSelectionFunction · 0.85
sliceMethod · 0.80
skipAtomicFunction · 0.70

Tested by

no test coverage detected