MCPcopy Create free account
hub / github.com/breck7/scroll / skipAtomic

Function skipAtomic

external/.scrollLibs.js:7060–7069  ·  view source on GitHub ↗
(doc, pos, oldPos, bias, mayClear)

Source from the content-addressed store, hash-verified

7058
7059 // Ensure a given position is not inside an atomic range.
7060 function skipAtomic(doc, pos, oldPos, bias, mayClear) {
7061 var dir = bias || 1
7062 var found =
7063 skipAtomicInner(doc, pos, oldPos, dir, mayClear) || (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) || skipAtomicInner(doc, pos, oldPos, -dir, mayClear) || (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true))
7064 if (!found) {
7065 doc.cantEdit = true
7066 return Pos(doc.first, 0)
7067 }
7068 return found
7069 }
7070
7071 function movePos(doc, pos, dir, line) {
7072 if (dir < 0 && pos.ch == 0) {

Callers 2

skipAtomicInSelectionFunction · 0.85
findPosHFunction · 0.85

Calls 2

skipAtomicInnerFunction · 0.85
PosFunction · 0.85

Tested by

no test coverage detected