Skip to main content

Module anchors

Module anchors 

Source
Expand description

Anchored offsets that stay stable under text edits.

Many editor features need to remember locations in the document (bookmarks, marks, jump list, snippets, …) and have those locations update when the document is edited.

This module provides a small, UI-agnostic anchored offset type (TextAnchor) plus rules for shifting it through crate::TextDelta edits.

Structs§

TextAnchor
A character-offset anchor that shifts through edits.

Enums§

AnchorBias
Bias controls how an anchor behaves when text is inserted exactly at the anchor offset.