mirror of
https://github.com/helix-editor/helix.git
synced 2024-12-18 14:01:55 +04:00
Show an error when formatter is not available (#12183)
This commit is contained in:
parent
085c4fe4c8
commit
7a2afdc080
@ -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>],
|
||||
|
Loading…
Reference in New Issue
Block a user