Skip to content

position

Contains utility functions for comparing positions within a file’s content.

Interface Description
Positioned Anything that carries a position within a file’s content: a reference cache, a heading, a section, a list item, and so on.
Function Description
isPositionInOffsetRange Checks if a position is fully contained within an offset range. Containment is full and both bounds are inclusive: a position that coincides exactly with the range is inside it, and one that only partially overlaps it is not.
isPositionInside Checks if a position is fully contained within another position. Only the offsets are compared. Containment is full and both bounds are inclusive: a position equal to the outer one is inside it, and one that only partially overlaps it is not.
isPositionInsideSome Checks if a position is fully contained within any of the given containers. Each container is a position, or anything that carries one (a reference cache, a heading, a section). The containment test is isPositionInside.
Type Description
PositionContainer A position, or anything that carries one.