Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/commands.rs')
| -rw-r--r-- | helix-term/src/commands.rs | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index aa159a99..583f46c3 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -3438,14 +3438,19 @@ async fn make_format_callback( let doc = doc_mut!(editor, &doc_id); let view = view_mut!(editor, view_id); - if let Ok(format) = format { - if doc.version() == doc_version { - doc.apply(&format, view.id); - doc.append_changes_to_history(view); - doc.detect_indent_and_line_ending(); - view.ensure_cursor_in_view(doc, scrolloff); - } else { - log::info!("discarded formatting changes because the document changed"); + match format { + Ok(format) => { + if doc.version() == doc_version { + doc.apply(&format, view.id); + doc.append_changes_to_history(view); + doc.detect_indent_and_line_ending(); + view.ensure_cursor_in_view(doc, scrolloff); + } else { + log::info!("discarded formatting changes because the document changed"); + } + } + Err(err) => { + log::info!("failed to format '{}': {err}", doc.display_name()); } } |