aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/state.rs
blob: 81b8e108e375b9773c50a2be3556e7c14a0a835c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use crate::{Buffer, Selection};

/// A state represents the current editor state of a single buffer.
pub struct State {
    // TODO: maybe doc: ?
    buffer: Buffer,
    selection: Selection,
}

impl State {
    pub fn new(buffer: Buffer) -> Self {
        Self {
            buffer,
            selection: Selection::single(0, 0),
        }
    }

    // TODO: buf/selection accessors

    // update/transact
    // replaceSelection (transaction that replaces selection)
    // changeByRange
    // changes
    // slice
    //
    // getters:
    // tabSize
    // indentUnit
    // languageDataAt()
    //
    // config:
    // indentation
    // tabSize
    // lineUnit
    // syntax
    // foldable
    // changeFilter/transactionFilter
}