Skip to content

Commit

Permalink
Fixed errors when running MagmaDelete
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBober committed Sep 16, 2022
1 parent ce56a23 commit 0b7d61e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions rplugin/python3/magma/magmabuffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ def reevaluate_cell(self) -> None:

def _check_if_done_running(self) -> None:
# TODO: refactor
is_idle = self.current_output is None or (
self.current_output is not None
is_idle = ( self.current_output is None
or not self.current_output in self.outputs
) or ( self.current_output is not None
and self.outputs[self.current_output].output.status
== OutputStatus.DONE
)
Expand All @@ -121,7 +122,7 @@ def tick(self) -> None:
self._check_if_done_running()

was_ready = self.runtime.is_ready()
if self.current_output is None:
if self.current_output is None or not self.current_output in self.outputs:
did_stuff = self.runtime.tick(None)
else:
did_stuff = self.runtime.tick(
Expand Down Expand Up @@ -155,7 +156,7 @@ def clear_interface(self) -> None:
-1,
)
# and self.nvim.funcs.winbufnr(self.display_window) != -1:
if self.selected_cell is not None:
if self.selected_cell is not None and self.selected_cell in self.outputs:
self.outputs[self.selected_cell].clear_interface()
self.canvas.clear()

Expand Down

0 comments on commit 0b7d61e

Please sign in to comment.