Register repl actions with editor after session started (#20396)
Makes repl actions that are specific to running kernels only come up after a session has been started at least once for the editor. Release Notes: - Only show session oriented `repl::` actions for editors after a session has been created
This commit is contained in:
parent
edb89d8d11
commit
706c385c24
3 changed files with 66 additions and 53 deletions
|
@ -97,58 +97,6 @@ pub fn init(cx: &mut AppContext) {
|
|||
}
|
||||
})
|
||||
.detach();
|
||||
|
||||
editor
|
||||
.register_action({
|
||||
let editor_handle = editor_handle.clone();
|
||||
move |_: &ClearOutputs, cx| {
|
||||
if !JupyterSettings::enabled(cx) {
|
||||
return;
|
||||
}
|
||||
|
||||
crate::clear_outputs(editor_handle.clone(), cx);
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
|
||||
editor
|
||||
.register_action({
|
||||
let editor_handle = editor_handle.clone();
|
||||
move |_: &Interrupt, cx| {
|
||||
if !JupyterSettings::enabled(cx) {
|
||||
return;
|
||||
}
|
||||
|
||||
crate::interrupt(editor_handle.clone(), cx);
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
|
||||
editor
|
||||
.register_action({
|
||||
let editor_handle = editor_handle.clone();
|
||||
move |_: &Shutdown, cx| {
|
||||
if !JupyterSettings::enabled(cx) {
|
||||
return;
|
||||
}
|
||||
|
||||
crate::shutdown(editor_handle.clone(), cx);
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
|
||||
editor
|
||||
.register_action({
|
||||
let editor_handle = editor_handle.clone();
|
||||
move |_: &Restart, cx| {
|
||||
if !JupyterSettings::enabled(cx) {
|
||||
return;
|
||||
}
|
||||
|
||||
crate::restart(editor_handle.clone(), cx);
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
})
|
||||
.detach();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue