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
608 stars 33 forks source link

fix: reevaluate not working #221

Closed thekalla closed 3 months ago

thekalla commented 3 months ago

Code cells that do not produce output, e.g. python import statements are not considered as code cells in the current buffer. As a consequence reevaluate cell and all is not working

benlubas commented 3 months ago

Hmm. I see the problem, but I'd prefer a more robust solution. With this change, if I open a notebook that's brand new, has never been run, molten will create cells with output for every code cell as if the cell was run.

I could see that behavior being useful though, it's just that the way it's displayed to the user is a little weird:

image

Done probably shouldn't show up if there's no execution count.


Separately, it seems like molten doesn't export the execution count with :MoltenExportOutput

benlubas commented 3 months ago

Would you be willing to look into changing the way cells with "execution_count": null are displayed when importing output? You can then leave the current change so that code cells with no output will still create a "molten cell" when you import.

otherwise, I can take a look at this later tonight or tomorrow

benlubas commented 3 months ago

see #224

@thekalla, I'd appreciate some feedback there, make sure this works the way you expect and if you have suggestions about the filler text for cells that haven't been run, leave them in that thread. I'll merge when you have commented or in a couple days