The post explores various text coordinate systems used in the Zed text editor, including Points, Offsets, DisplayPoints, and Anchors. It explains each system's purpose and nuances, such as how Points are zero-indexed positions in a text buffer, Offsets represent a position as a single count of characters, and DisplayPoints account for visible text formatting like soft-wrapping and folding. Anchors are unique in their use for maintaining positional consistency even as the document is edited, crucial for collaborative environments.

11m read timeFrom zed.dev
Post cover image
Table of contents
Point self.__wrap_n!=1&&self.__wrap_b(":R57brrrqbf9la:",1)Offset self.__wrap_n!=1&&self.__wrap_b(":Rk7brrrqbf9la:",1)DisplayPoints self.__wrap_n!=1&&self.__wrap_b(":R127brrrqbf9la:",1)Anchors self.__wrap_n!=1&&self.__wrap_b(":R1q7brrrqbf9la:",1)
5 Comments

Sort: