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

Method _getAtomIndexCharacterStartPosition

external/.scrollLibs.js:15555–15561  ·  view source on GitHub ↗
(atomIndex)

Source from the content-addressed store, hash-verified

15553 return [oneToTwo, twoToOne]
15554 }
15555 _getAtomIndexCharacterStartPosition(atomIndex) {
15556 const xiLength = this.edgeSymbol.length
15557 const numIndents = this._getIndentLevel() - 1
15558 const indentPosition = xiLength * numIndents
15559 if (atomIndex < 1) return xiLength * (numIndents + atomIndex)
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)

Callers 1

getAtomPropertiesMethod · 0.95

Calls 3

_getIndentLevelMethod · 0.95
sliceMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected