diff options
author | Ivan Tham | 2023-01-21 18:13:43 +0000 |
---|---|---|
committer | GitHub | 2023-01-21 18:13:43 +0000 |
commit | a20a96abdcfbea3b3eb890bfc266850938434a90 (patch) | |
tree | df1300dfc07f671c11abb195a62ba3f20ea510c6 /helix-term/src/ui | |
parent | 68fc10903aad7b5dbb5b8be4ee17343e1a1b8f6c (diff) |
Remove apply_transaction helper (#5598)
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r-- | helix-term/src/ui/completion.rs | 8 | ||||
-rw-r--r-- | helix-term/src/ui/editor.rs | 3 |
2 files changed, 5 insertions, 6 deletions
diff --git a/helix-term/src/ui/completion.rs b/helix-term/src/ui/completion.rs index 824bafd8..2eca709d 100644 --- a/helix-term/src/ui/completion.rs +++ b/helix-term/src/ui/completion.rs @@ -1,5 +1,5 @@ use crate::compositor::{Component, Context, Event, EventResult}; -use helix_view::{apply_transaction, editor::CompleteAction, ViewId}; +use helix_view::{editor::CompleteAction, ViewId}; use tui::buffer::Buffer as Surface; use std::borrow::Cow; @@ -183,7 +183,7 @@ impl Completion { // initialize a savepoint doc.savepoint(); - apply_transaction(&transaction, doc, view); + doc.apply(&transaction, view.id); editor.last_completion = Some(CompleteAction { trigger_offset, @@ -203,7 +203,7 @@ impl Completion { trigger_offset, ); - apply_transaction(&transaction, doc, view); + doc.apply(&transaction, view.id); editor.last_completion = Some(CompleteAction { trigger_offset, @@ -233,7 +233,7 @@ impl Completion { additional_edits.clone(), offset_encoding, // TODO: should probably transcode in Client ); - apply_transaction(&transaction, doc, view); + doc.apply(&transaction, view.id); } } } diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index f8244600..a0518964 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -17,7 +17,6 @@ use helix_core::{ visual_coords_at_pos, LineEnding, Position, Range, Selection, Transaction, }; use helix_view::{ - apply_transaction, document::{Mode, SCRATCH_BUFFER_NAME}, editor::{CompleteAction, CursorShapeConfig}, graphics::{Color, CursorKind, Modifier, Rect, Style}, @@ -1048,7 +1047,7 @@ impl EditorView { (shift_position(start), shift_position(end), t) }), ); - apply_transaction(&tx, doc, view); + doc.apply(&tx, view.id); } InsertEvent::TriggerCompletion => { let (_, doc) = current!(cxt.editor); |