12
12
13
13
This document contains a high-level overview of Helix internals.
14
14
15
+ > NOTE: Use ` cargo doc --open ` for API documentation as well as dependency
16
+ > documentation.
17
+
15
18
## Core
16
19
17
20
The core contains basic building blocks used to construct the editor. It is
@@ -20,13 +23,21 @@ are functional: most operations won't modify data in place but instead return
20
23
a new copy.
21
24
22
25
The main data structure used for representing buffers is a ` Rope ` . We re-export
23
- asaddthe excellent [ ropey] ( https://github.com/cessen/ropey ) library. Ropes are cheap
26
+ the excellent [ ropey] ( https://github.com/cessen/ropey ) library. Ropes are cheap
24
27
to clone, and allow us to easily make snapshots of a text state.
25
28
26
29
Multiple selections are a core editing primitive. Document selections are
27
30
represented by a ` Selection ` . Each ` Range ` in the selection consists of a moving
28
31
` head ` and an immovable ` anchor ` . A single cursor in the editor is simply
29
- a selction with a single range, with the head and the anchor in the same
32
+ a selection with a single range, with the head and the anchor in the same
33
+ position.
34
+
35
+ Ropes are modified by constructing an OT-like ` Transaction ` . It represents
36
+ a single coherent change to the document and can be applied to the rope.
37
+ A transaction can be inverted to produce an undo. Selections and marks can be
38
+ mapped over a transaction to translate to a position in the new text state after
39
+ applying the transaction.
40
+
30
41
> NOTE: ` Transaction::change ` /` Transaction::change_by_selection ` is the main
31
42
> interface used to generate text edits.
32
43
@@ -97,3 +108,4 @@ The `main` function sets up a new `Application` that runs the event loop.
97
108
98
109
## TUI / Term
99
110
111
+ TODO: document Component and rendering related stuff
0 commit comments