Skip to content

vyaz-monorepo / renderers/src / posToCharIndex

Function: posToCharIndex()

posToCharIndex(lines, pos): number

Defined in: renderers/src/interactive.ts:264

Compute the global character index from a CharPos.

This walks all preceding lines/spans/characters to compute the absolute index in the full text.

Parameters

lines

Line[]

pos

CharPos

Returns

number

Released under the MIT License.