Unnamed repository; edit this file 'description' to name the repository.
Set a statusline error for formatter errors in `:format`
Michael Davis 2025-02-01
parent 2367b20 · commit 47f84d0
-rw-r--r--helix-term/src/commands.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index db912e6c..6f0bc394 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -3514,6 +3514,10 @@ async fn make_format_callback(
}
}
Err(err) => {
+ if write.is_none() {
+ editor.set_error(err.to_string());
+ return;
+ }
log::info!("failed to format '{}': {err}", doc.display_name());
}
}