benlubas / molten-nvim

A neovim plugin for interactively running code with the jupyter kernel. Fork of magma-nvim with improvements in image rendering, performance, and more
GNU General Public License v3.0
531 stars 30 forks source link

fix(import): create molten cells for code that runs with no output #224

Closed benlubas closed 1 month ago

benlubas commented 1 month ago

supersedes #221

Code cells that do not produce output, e.g. python import statements are not considered as code cells when importing outputs.

As a consequence :MoltenReevaluateCell/All fails unexpectedly after importing output from an ipynb file.


The fix for this issue comes with a new feature. There's a new output status NEW. New cells have no output, and have never been run (execution count == null), currently they're only created by the :MoltenImportOutput command, and they show Out[_]: Never Run in virtual text or the floating window.

The import script no longer breaks on cells that have a 0 length output list, and instead will create a molten cell, marked either DONE or NEW based on the exec count.

If someone has a more concise or otherwise better way to communicate Never Run I'd love suggestions. I personally don't like the text Never Run but need something to be there.

thekalla commented 1 month ago

sorry, vacation time.. works perfectly for me. Thank you for the PR