---
title: "Text Coordinate Systems"
description: "Zed represents text positions with several coordinate types, each suited to a different job."
url: "https://swe.quest/articles/text-coordinate-systems-5ea8fbb000ee9f93"
canonical: "https://zed.dev/blog/zed-decoded-text-coordinate-systems"
source: "Zed"
published: "2024-06-27"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 11
tags: ["rust","data-structures","developer-tools","realtime","time-clocks"]
---

# Text Coordinate Systems

A post on [Zed](https://swe.quest/sources/zed.md), published 2024-06-27, 11 min read, Deep dive. Original: [https://zed.dev/blog/zed-decoded-text-coordinate-systems](https://zed.dev/blog/zed-decoded-text-coordinate-systems)

## Summary

Zed represents text positions with several coordinate types, each suited to a different job. \`Point\` (row/column) makes vertical movement easy but follows "typewriter" addition semantics, and \`Offset\` counts bytes from the start of the document, which suits multi-line ranges. \`OffsetUtf16\` and \`PointUtf16\` exist for the Language Server Protocol and are indexed directly in the Rope's SumTree, so conversions are fast. \`DisplayPoint\` maps positions onto the rendered view, accounting for soft wraps, folds, inlay hints, tabs and blocks. \`Anchor\` is a logical position tied to a Lamport-timestamped immutable insertion in Zed's CRDT, so it stays valid across concurrent edits and background work such as language-server requests.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Rust](https://swe.quest/tags/rust.md) (Languages)
- [Data structures](https://swe.quest/tags/data-structures.md) (Architecture & design)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)
- [Real-time systems](https://swe.quest/tags/realtime.md) (Backend & APIs)
- [Time & clocks](https://swe.quest/tags/time-clocks.md) (Distributed systems)

## Prerequisites

- Rust basics ([easy posts on Rust](https://swe.quest/tags/rust.md?difficulty=easy))
- text encodings (UTF-8/UTF-16)
- CRDT basics ([easy posts on Consistency models](https://swe.quest/tags/consistency.md?difficulty=easy))

## Keywords

Zed, Language Server Protocol, Rope, SumTree, CRDT, Lamport timestamp, DisplayMap

## Related posts

- [How CRDTs make multiplayer text editing part of Zed's DNA](https://swe.quest/articles/how-crdts-make-multiplayer-text-editing-part-of-zed-s-dna-b0f0df37585dbddf.md): Zed · 2022-12-01 · Medium · 12 min read · Local-first & sync, Real-time systems, Consistency models, Algorithms, Rust
  Zed builds collaborative editing into its core using CRDTs rather than Operational Transformation, making concurrent edits commutative by addressing text through stable logical anchors (insertion id plus offset) instead of absolute offsets.
- [Zed Weekly: #21](https://swe.quest/articles/zed-weekly-21-6f0d0de0d9285330.md): Zed · 2023-09-29 · Easy · 7 min read · Developer tools, Frontend, Rust
  Weekly team update from the Zed editor team. It covers initial Prettier integration and better LSP server log display, a storybook CLI for rendering new GPUI UI components in isolation, and Vim mode's command palette shipping to preview.
- [This Week at Zed Industries: #14](https://swe.quest/articles/this-week-at-zed-industries-14-199a97b20076bb41.md): Zed · 2023-08-04 · Easy · 6 min read · Distributed systems, Replication, Data structures, Developer tools, Rust
  Zed's weekly update covers a reworked search UI with semantic search, the start of WebAssembly extensions for custom language servers, and near-complete collaboration channels.
- [This Week at Zed Industries: #12](https://swe.quest/articles/this-week-at-zed-industries-12-12effbc7b871501a.md): Zed · 2023-07-21 · Medium · 7 min read · Rust, Real-time systems, Consistency models, Developer tools, Replication
  Zed publicly launched its preview channel and reports progress across the editor: Vim search commands, macOS ctrl-click remapped to right click in the platform layer, terminal Cmd+hover navigation, a semantic index that collapses nested tree-sitter symbols to cut embedding tokens, and a lock-contention bug where slow git status in huge repos serializes file scanning.
- [Rope & SumTree](https://swe.quest/articles/rope-sumtree-f2c50a52279e3db4.md): Zed · 2024-04-23 · Medium · 22 min read · Data structures, Rust, Developer tools, Concurrency
  Zed represents buffer text with a rope rather than a string, because contiguous strings make mid-file inserts and deletes, line navigation and very large files expensive.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
