mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-09-20 10:05:57 +08:00
Add notbook runtime settings shortcut (#176)
This commit is contained in:
parent
fd65ebfaa5
commit
623c5b3290
|
@ -155,6 +155,8 @@ function handleDocumentKeyDown(hook, event) {
|
||||||
toggleSectionsPanel(hook);
|
toggleSectionsPanel(hook);
|
||||||
} else if (keyBuffer.tryMatch(["s", "n"])) {
|
} else if (keyBuffer.tryMatch(["s", "n"])) {
|
||||||
showNotebookSettings(hook);
|
showNotebookSettings(hook);
|
||||||
|
} else if (keyBuffer.tryMatch(["s", "r"])) {
|
||||||
|
showNotebookRuntimeSettings(hook);
|
||||||
} else if (keyBuffer.tryMatch(["e", "x"])) {
|
} else if (keyBuffer.tryMatch(["e", "x"])) {
|
||||||
cancelFocusedCellEvaluation(hook);
|
cancelFocusedCellEvaluation(hook);
|
||||||
} else if (keyBuffer.tryMatch(["?"])) {
|
} else if (keyBuffer.tryMatch(["?"])) {
|
||||||
|
@ -303,6 +305,10 @@ function showNotebookSettings(hook) {
|
||||||
hook.pushEvent("show_notebook_settings", {});
|
hook.pushEvent("show_notebook_settings", {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showNotebookRuntimeSettings(hook) {
|
||||||
|
hook.pushEvent("show_notebook_runtime_settings", {});
|
||||||
|
}
|
||||||
|
|
||||||
function deleteFocusedCell(hook) {
|
function deleteFocusedCell(hook) {
|
||||||
if (hook.state.focusedCellId) {
|
if (hook.state.focusedCellId) {
|
||||||
hook.pushEvent("delete_cell", { cell_id: hook.state.focusedCellId });
|
hook.pushEvent("delete_cell", { cell_id: hook.state.focusedCellId });
|
||||||
|
|
|
@ -361,6 +361,13 @@ defmodule LivebookWeb.SessionLive do
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def handle_event("show_notebook_runtime_settings", %{}, socket) do
|
||||||
|
{:noreply,
|
||||||
|
push_patch(socket,
|
||||||
|
to: Routes.session_path(socket, :settings, socket.assigns.session_id, "runtime")
|
||||||
|
)}
|
||||||
|
end
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def handle_info({:operation, operation}, socket) do
|
def handle_info({:operation, operation}, socket) do
|
||||||
case Session.Data.apply_operation(socket.private.data, operation) do
|
case Session.Data.apply_operation(socket.private.data, operation) do
|
||||||
|
|
|
@ -25,7 +25,8 @@ defmodule LivebookWeb.SessionLive.ShortcutsComponent do
|
||||||
%{seq: ["ej"], desc: "Evaluate cells below"},
|
%{seq: ["ej"], desc: "Evaluate cells below"},
|
||||||
%{seq: ["ex"], desc: "Cancel cell evaluation"},
|
%{seq: ["ex"], desc: "Cancel cell evaluation"},
|
||||||
%{seq: ["ss"], desc: "Toggle sections panel"},
|
%{seq: ["ss"], desc: "Toggle sections panel"},
|
||||||
%{seq: ["sn"], desc: "Show notebook settings"}
|
%{seq: ["sn"], desc: "Show notebook settings"},
|
||||||
|
%{seq: ["sr"], desc: "Show notebook runtime settings"}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue