diff options
Diffstat (limited to 'helix-core')
-rw-r--r-- | helix-core/src/lib.rs | 2 | ||||
-rw-r--r-- | helix-core/src/transaction.rs | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/helix-core/src/lib.rs b/helix-core/src/lib.rs index 8458c36f..ddf1439c 100644 --- a/helix-core/src/lib.rs +++ b/helix-core/src/lib.rs @@ -27,4 +27,4 @@ pub use diagnostic::Diagnostic; pub use history::History; pub use state::State; -pub use transaction::{Assoc, Change, ChangeSet, Transaction}; +pub use transaction::{Assoc, Change, ChangeSet, Operation, Transaction}; diff --git a/helix-core/src/transaction.rs b/helix-core/src/transaction.rs index 9bd8c615..f1cb2ca1 100644 --- a/helix-core/src/transaction.rs +++ b/helix-core/src/transaction.rs @@ -5,8 +5,9 @@ use std::convert::TryFrom; /// (from, to, replacement) pub type Change = (usize, usize, Option<Tendril>); +// TODO: pub(crate) #[derive(Debug, Clone, PartialEq, Eq)] -pub(crate) enum Operation { +pub enum Operation { /// Move cursor by n characters. Retain(usize), /// Delete n characters. @@ -40,6 +41,12 @@ impl ChangeSet { } // TODO: from iter + // + + #[doc(hidden)] // used by lsp to convert to LSP changes + pub fn changes(&self) -> &[Operation] { + &self.changes + } #[must_use] fn len_after(&self) -> usize { |