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

Method getParticleInScopeAtCharIndex

external/.scrollLibs.js:15562–15572  ·  view source on GitHub ↗
(charIndex)

Source from the content-addressed store, hash-verified

15560 return indentPosition + this.atoms.slice(0, atomIndex).join(this.atomBreakSymbol).length + this.atomBreakSymbol.length
15561 }
15562 getParticleInScopeAtCharIndex(charIndex) {
15563 if (this.isRoot()) return this
15564 let atomIndex = this.getAtomIndexAtCharacterIndex(charIndex)
15565 if (atomIndex > 0) return this
15566 let particle = this
15567 while (atomIndex < 1) {
15568 particle = particle.parent
15569 atomIndex++
15570 }
15571 return particle
15572 }
15573 getAtomProperties(atomIndex) {
15574 const start = this._getAtomIndexCharacterStartPosition(atomIndex)
15575 const atom = atomIndex < 0 ? "" : this.getAtom(atomIndex)

Callers 1

Calls 2

isRootMethod · 0.95

Tested by

no test coverage detected