Skip to main content

Module position

Module position 

Source
Expand description

Logical positions and ranges within a buffer.

Per §5.6.4: core, plugins, and the dispatcher deal exclusively in logical positions (line, byte). The renderer translates to visual positions when drawing. Plugins never see pixels.

Byte offsets, not chars or UTF-16 code units: the rope and tree-sitter both index by byte, so the hot path never converts. Protocol peers that count differently (LSP’s UTF-16 character) convert at their own boundary.

Structs§

Position
A logical cursor position: zero-based line, zero-based byte offset within that line. UTF-8 byte offsets, not codepoint indices.
Range
A half-open [start, end) range expressed as two Positions.