repl: Add ctrl-alt-enter binding to run in place (#15743)
Release Notes: - Added `ctrl-alt-enter` keybinding for `repl::RunInPlace` (`ctrl-option-enter` on MacOS). Keeps your screen position and cursor in place when running any block.
This commit is contained in:
parent
b7eae7fbd9
commit
f8234aec6a
6 changed files with 29 additions and 11 deletions
|
@ -17,6 +17,7 @@ actions!(
|
|||
repl,
|
||||
[
|
||||
Run,
|
||||
RunInPlace,
|
||||
ClearOutputs,
|
||||
Sessions,
|
||||
Interrupt,
|
||||
|
@ -68,7 +69,20 @@ pub fn init(cx: &mut AppContext) {
|
|||
return;
|
||||
}
|
||||
|
||||
crate::run(editor_handle.clone(), cx).log_err();
|
||||
crate::run(editor_handle.clone(), true, cx).log_err();
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
|
||||
editor
|
||||
.register_action({
|
||||
let editor_handle = editor_handle.clone();
|
||||
move |_: &RunInPlace, cx| {
|
||||
if !JupyterSettings::enabled(cx) {
|
||||
return;
|
||||
}
|
||||
|
||||
crate::run(editor_handle.clone(), false, cx).log_err();
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue