Add shortcut for evaluating a cell and advancing to the next one (#1294)

This commit is contained in:
Kuria 2022-07-23 13:22:17 +03:00 committed by GitHub
parent 9cbecb6871
commit 3cf175c81a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View file

@ -295,6 +295,13 @@ const Session = {
cancelEvent(event);
this.queueFullCellsEvaluation(true);
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") {
cancelEvent(event);
if (isEvaluable(this.focusedCellType())) {

View file

@ -112,6 +112,13 @@ defmodule LivebookWeb.SessionLive.ShortcutsComponent do
desc: "Evaluate cell in either mode",
basic: true
},
%{
seq: ["shift", ""],
seq_mac: ["", ""],
press_all: true,
desc: "Evaluate cell and advance to next one",
basic: true
},
%{
seq: ["ctrl", "shift", ""],
seq_mac: ["", "", ""],