diff --git a/helix-term/src/commands/engine/steel.rs b/helix-term/src/commands/engine/steel.rs index 165cd5b91..1d4ee6a02 100644 --- a/helix-term/src/commands/engine/steel.rs +++ b/helix-term/src/commands/engine/steel.rs @@ -3669,10 +3669,23 @@ callback : (-> any?) ``` "# ); + register_1!( "set-status!", set_status, - "Sets the content of the status line" + "Sets the content of the status line, with the info severity" + ); + + register_1!( + "set-warning!", + set_warning, + "Sets the content of the status line, with the warning severity" + ); + + register_1!( + "set-error!", + set_error, + "Sets the content of the status line, with the error severity" ); module.register_fn("send-lsp-command", send_arbitrary_lsp_command); @@ -4706,6 +4719,20 @@ fn set_status(cx: &mut Context, value: SteelVal) { } } +fn set_warning(cx: &mut Context, value: SteelVal) { + match value { + SteelVal::StringV(s) => cx.editor.set_warning(s.as_ref().to_owned()), + _ => cx.editor.set_warning(value.to_string()), + } +} + +fn set_error(cx: &mut Context, value: SteelVal) { + match value { + SteelVal::StringV(s) => cx.editor.set_error(s.as_ref().to_owned()), + _ => cx.editor.set_error(value.to_string()), + } +} + fn enqueue_command(cx: &mut Context, callback_fn: SteelVal) { let rooted = callback_fn.as_rooted();