diff options
author | Blaž Hrastnik | 2020-09-07 02:28:52 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2020-09-07 02:28:52 +0000 |
commit | 8b3e152126ec8f0e67dad378dc62c734ea97a4b0 (patch) | |
tree | 5109f5fb4a7709eafd2fb3b493c6e7d56e269e5a /helix-core/src/transaction.rs | |
parent | 579b6899f1fe7f0a06857c4528f55f316e2975e9 (diff) |
cleanup: Make Buffer just a part of State.
Diffstat (limited to 'helix-core/src/transaction.rs')
-rw-r--r-- | helix-core/src/transaction.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/helix-core/src/transaction.rs b/helix-core/src/transaction.rs index 2d8afc9b..d078679c 100644 --- a/helix-core/src/transaction.rs +++ b/helix-core/src/transaction.rs @@ -1,4 +1,4 @@ -use crate::{Buffer, Rope, Selection, Tendril}; +use crate::{Rope, Selection, Tendril}; // TODO: divided into three different operations, I sort of like having just // Splice { extent, Option<text>, distance } better. @@ -39,16 +39,16 @@ pub struct ChangeSet { impl ChangeSet { #[must_use] - pub fn new(buf: &Buffer) -> Self { - let len = buf.contents.len_chars(); + pub fn new(doc: &Rope) -> Self { + let len = doc.len_chars(); Self { changes: vec![Change::Retain(len)], len, } } - pub fn insert(buf: &Buffer, pos: usize, c: char) -> Self { - let len = buf.contents.len_chars(); + pub fn insert(doc: &Rope, pos: usize, c: char) -> Self { + let len = doc.len_chars(); Self { changes: vec![ Change::Retain(pos), |