Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--helix-term/src/commands/typed.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index 3fd86ffd..4e3946a3 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -456,13 +456,15 @@ fn format(
}
let (view, doc) = current!(cx.editor);
- if let Some(format) = doc.format() {
- let callback = make_format_callback(doc.id(), doc.version(), view.id, format, None);
- cx.jobs.callback(callback);
- }
+ let format = doc.format().context(
+ "A formatter isn't available, and no language server provides formatting capabilities",
+ )?;
+ let callback = make_format_callback(doc.id(), doc.version(), view.id, format, None);
+ cx.jobs.callback(callback);
Ok(())
}
+
fn set_indent_style(
cx: &mut compositor::Context,
args: &[Cow<str>],