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
|
@ -12,7 +12,7 @@ use crate::repl_store::ReplStore;
|
|||
use crate::session::SessionEvent;
|
||||
use crate::{KernelSpecification, Session};
|
||||
|
||||
pub fn run(editor: WeakView<Editor>, cx: &mut WindowContext) -> Result<()> {
|
||||
pub fn run(editor: WeakView<Editor>, move_down: bool, cx: &mut WindowContext) -> Result<()> {
|
||||
let store = ReplStore::global(cx);
|
||||
if !store.read(cx).is_enabled() {
|
||||
return Ok(());
|
||||
|
@ -89,7 +89,7 @@ pub fn run(editor: WeakView<Editor>, cx: &mut WindowContext) -> Result<()> {
|
|||
}
|
||||
|
||||
session.update(cx, |session, cx| {
|
||||
session.execute(selected_text, anchor_range, next_cursor, cx);
|
||||
session.execute(selected_text, anchor_range, next_cursor, move_down, cx);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue