on master help sign in
Use helix_view::apply_transaction in integration-tests
1243db1Michael Davis
helix-term/tests/test/helpers.rs+7−8
@@ -125,13 +125,12 @@ pub async fn test_key_sequence_with_input_text<T: Into<TestCase>>(
125 let sel = doc.selection(view.id).clone();
125 let sel = doc.selection(view.id).clone();
126
126
127 // replace the initial text with the input text
127 // replace the initial text with the input text
128− doc.apply(
129− &Transaction::change_by_selection(doc.text(), &sel, |_| {
128+ let transaction = Transaction::change_by_selection(doc.text(), &sel, |_| {
130− (0, doc.text().len_chars(), Some((&test_case.in_text).into()))
129+ (0, doc.text().len_chars(), Some((&test_case.in_text).into()))
131− })
130+ })
132− .with_selection(test_case.in_selection.clone()),
131+ .with_selection(test_case.in_selection.clone());
133− view.id,
132+
134− );
133+ helix_view::apply_transaction(&transaction, doc, view);
135
134
136 test_key_sequence(
135 test_key_sequence(
137 &mut app,
136 &mut app,
@@ -286,7 +285,7 @@ impl AppBuilder {
286 .with_selection(selection);
285 .with_selection(selection);
287
286
288 // replace the initial text with the input text
287 // replace the initial text with the input text
289− doc.apply(&trans, view.id);
288+ helix_view::apply_transaction(&trans, doc, view);
290 }
289 }
291
290
292 Ok(app)
291 Ok(app)