aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/view.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-10-04 08:15:43 +0000
committerBlaž Hrastnik2020-10-13 14:13:56 +0000
commitfd311fb8ad8792c8f21ed0bcf56d4a818715d5f7 (patch)
treed44c2771759605fac1541b2973297af3ce21a8e2 /helix-view/src/view.rs
parent9a73d3f1b97d41aab101262ce72fc3019c4a0f91 (diff)
Undo tree draft.
We keep a tree of transactions. This allows for persistent undo by simply serializing the changesets.
Diffstat (limited to 'helix-view/src/view.rs')
-rw-r--r--helix-view/src/view.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/helix-view/src/view.rs b/helix-view/src/view.rs
index 887c45a2..732c5081 100644
--- a/helix-view/src/view.rs
+++ b/helix-view/src/view.rs
@@ -5,12 +5,13 @@ use std::{borrow::Cow, path::PathBuf};
use crate::theme::Theme;
use helix_core::{
graphemes::{grapheme_width, RopeGraphemes},
- Position, RopeSlice, State,
+ History, Position, RopeSlice, State,
};
use tui::layout::Rect;
pub struct View {
pub state: State,
+ pub history: History,
pub first_line: usize,
pub size: (u16, u16),
pub theme: Theme, // TODO: share one instance
@@ -26,6 +27,7 @@ impl View {
first_line: 0,
size, // TODO: pass in from term
theme,
+ history: History::default(),
};
Ok(view)