Skip to content

Commit 8b03da8

Browse files
authored
Try to fix #6
1 parent 6548584 commit 8b03da8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/jupyter_notebook.m

+6
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,12 @@ function run_all (obj)
510510
retval = strtrim (evalc (__code__, ["printf (\"error: \"); ", ...
511511
"printf (lasterror.message)"]));
512512

513+
## Restore __obj__ in case of "clear all".
514+
## Does not work until bug #62077 is resolved.
515+
if (exist ("__obj__", "var") != 1)
516+
__obj__ = evalin ("caller", "obj");
517+
endif
518+
513519
## Handle the "ans" variable in the context.
514520
start_index = rindex (retval, "ans =") + 6;
515521
if (start_index > 6)

0 commit comments

Comments
 (0)