mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-09 21:16:26 +08:00
Add shortcut for evaluating a cell and advancing to the next one (#1294)
This commit is contained in:
parent
9cbecb6871
commit
3cf175c81a
2 changed files with 14 additions and 0 deletions
|
@ -295,6 +295,13 @@ const Session = {
|
||||||
cancelEvent(event);
|
cancelEvent(event);
|
||||||
this.queueFullCellsEvaluation(true);
|
this.queueFullCellsEvaluation(true);
|
||||||
return;
|
return;
|
||||||
|
} else if (!cmd && shift && !alt && key === "Enter") {
|
||||||
|
cancelEvent(event);
|
||||||
|
if (isEvaluable(this.focusedCellType())) {
|
||||||
|
this.queueFocusedCellEvaluation();
|
||||||
|
}
|
||||||
|
this.moveFocus(1);
|
||||||
|
return;
|
||||||
} else if (cmd && !alt && key === "Enter") {
|
} else if (cmd && !alt && key === "Enter") {
|
||||||
cancelEvent(event);
|
cancelEvent(event);
|
||||||
if (isEvaluable(this.focusedCellType())) {
|
if (isEvaluable(this.focusedCellType())) {
|
||||||
|
|
|
@ -112,6 +112,13 @@ defmodule LivebookWeb.SessionLive.ShortcutsComponent do
|
||||||
desc: "Evaluate cell in either mode",
|
desc: "Evaluate cell in either mode",
|
||||||
basic: true
|
basic: true
|
||||||
},
|
},
|
||||||
|
%{
|
||||||
|
seq: ["shift", "↵"],
|
||||||
|
seq_mac: ["⇧", "↵"],
|
||||||
|
press_all: true,
|
||||||
|
desc: "Evaluate cell and advance to next one",
|
||||||
|
basic: true
|
||||||
|
},
|
||||||
%{
|
%{
|
||||||
seq: ["ctrl", "shift", "↵"],
|
seq: ["ctrl", "shift", "↵"],
|
||||||
seq_mac: ["⌘", "⇧", "↵"],
|
seq_mac: ["⌘", "⇧", "↵"],
|
||||||
|
|
Loading…
Add table
Reference in a new issue