MCPcopy Create free account
hub / github.com/TruthHun/BookStack / skipAtomic

Function skipAtomic

static/mergely/lib/codemirror.js:2273–2284  ·  view source on GitHub ↗
(doc, pos, oldPos, bias, mayClear)

Source from the content-addressed store, hash-verified

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

Callers 2

skipAtomicInSelectionFunction · 0.70
findPosHFunction · 0.70

Calls 1

skipAtomicInnerFunction · 0.85

Tested by

no test coverage detected