mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-01-07 23:47:53 +08:00
Queue cells on ctrl+shift+enter even when a cells is evaluating (#1334)
This commit is contained in:
parent
7f4e9273de
commit
d24cb8a838
2 changed files with 16 additions and 0 deletions
|
@ -1893,6 +1893,8 @@ defmodule Livebook.Session.Data do
|
|||
evaluable_cell_ids =
|
||||
for {cell, _} <- evaluable_cells_with_section,
|
||||
cell_outdated?(data, cell) or cell.id in forced_cell_ids,
|
||||
info = data.cell_infos[cell.id],
|
||||
info.eval.status == :ready,
|
||||
uniq: true,
|
||||
do: cell.id
|
||||
|
||||
|
|
|
@ -3562,6 +3562,20 @@ defmodule Livebook.Session.DataTest do
|
|||
|
||||
assert Data.cell_ids_for_full_evaluation(data, ["c2"]) |> Enum.sort() == ["c2", "c3"]
|
||||
end
|
||||
|
||||
test "excludes evaluating and queued cells" do
|
||||
data =
|
||||
data_after_operations!([
|
||||
{:insert_section, @cid, 0, "s1"},
|
||||
{:insert_cell, @cid, "s1", 0, :code, "c1", %{}},
|
||||
{:insert_cell, @cid, "s1", 1, :code, "c2", %{}},
|
||||
{:insert_cell, @cid, "s1", 2, :code, "c3", %{}},
|
||||
{:set_runtime, @cid, connected_noop_runtime()},
|
||||
{:queue_cells_evaluation, @cid, ["c1", "c2"]}
|
||||
])
|
||||
|
||||
assert Data.cell_ids_for_full_evaluation(data, []) |> Enum.sort() == ["c3"]
|
||||
end
|
||||
end
|
||||
|
||||
describe "cell_ids_for_reevaluation/2" do
|
||||
|
|
Loading…
Reference in a new issue