mirror of https://github.com/helix-editor/helix
add warning and error
parent
ef7ea0f519
commit
557aa9cc19
|
@ -3669,10 +3669,23 @@ callback : (-> any?)
|
||||||
```
|
```
|
||||||
"#
|
"#
|
||||||
);
|
);
|
||||||
|
|
||||||
register_1!(
|
register_1!(
|
||||||
"set-status!",
|
"set-status!",
|
||||||
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);
|
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) {
|
fn enqueue_command(cx: &mut Context, callback_fn: SteelVal) {
|
||||||
let rooted = callback_fn.as_rooted();
|
let rooted = callback_fn.as_rooted();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue