diff options
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r-- | helix-term/src/commands.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index f12c79f9..7e757ce1 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -28,7 +28,7 @@ use helix_core::{ }; use helix_view::{ clipboard::ClipboardType, - document::{Mode, SCRATCH_BUFFER_NAME}, + document::{FormatterError, Mode, SCRATCH_BUFFER_NAME}, editor::{Action, Motion}, info::Info, input::KeyEvent, @@ -2471,14 +2471,14 @@ async fn make_format_callback( doc_id: DocumentId, doc_version: i32, modified: Modified, - format: impl Future<Output = helix_lsp::util::LspFormatting> + Send + 'static, + format: impl Future<Output = Result<Transaction, FormatterError>> + Send + 'static, ) -> anyhow::Result<job::Callback> { - let format = format.await; + let format = format.await?; let call: job::Callback = Box::new(move |editor, _compositor| { let view_id = view!(editor).id; if let Some(doc) = editor.document_mut(doc_id) { if doc.version() == doc_version { - doc.apply(&Transaction::from(format), view_id); + doc.apply(&format, view_id); doc.append_changes_to_history(view_id); doc.detect_indent_and_line_ending(); if let Modified::SetUnmodified = modified { |