MCPcopy Index your code
hub / github.com/DHTMLX/gantt / skipAtomicInSelection

Function skipAtomicInSelection

samples/common/codehighlight/codemirror.js:5146–5159  ·  view source on GitHub ↗
(doc, sel, bias, mayClear)

Source from the content-addressed store, hash-verified

5144 // Return a selection that does not partially select any atomic
5145 // ranges.
5146 function skipAtomicInSelection(doc, sel, bias, mayClear) {
5147 var out;
5148 for (var i = 0; i < sel.ranges.length; i++) {
5149 var range = sel.ranges[i];
5150 var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];
5151 var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);
5152 var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);
5153 if (out || newAnchor != range.anchor || newHead != range.head) {
5154 if (!out) { out = sel.ranges.slice(0, i); }
5155 out[i] = new Range(newAnchor, newHead);
5156 }
5157 }
5158 return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel
5159 }
5160
5161 function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {
5162 var line = getLine(doc, pos.line);

Callers 2

setSelectionNoUndoFunction · 0.85
reCheckSelectionFunction · 0.85

Calls 2

skipAtomicFunction · 0.85
normalizeSelectionFunction · 0.85

Tested by

no test coverage detected