MCPcopy
hub / github.com/witheve/Eve / skipAtomic

Function skipAtomic

src/codemirror.js:2280–2291  ·  view source on GitHub ↗
(doc, pos, oldPos, bias, mayClear)

Source from the content-addressed store, hash-verified

2278
2279 // Ensure a given position is not inside an atomic range.
2280 function skipAtomic(doc, pos, oldPos, bias, mayClear) {
2281 var dir = bias || 1;
2282 var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||
2283 (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||
2284 skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||
2285 (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));
2286 if (!found) {
2287 doc.cantEdit = true;
2288 return Pos(doc.first, 0);
2289 }
2290 return found;
2291 }
2292
2293 function movePos(doc, pos, dir, line) {
2294 if (dir < 0 && pos.ch == 0) {

Callers 2

skipAtomicInSelectionFunction · 0.85
findPosHFunction · 0.85

Calls 1

skipAtomicInnerFunction · 0.85

Tested by

no test coverage detected