Open kylebarron opened 6 years ago
If I were to submit a PR for this, would this be considered? Or is this behavior not desired?
Hi @kylebarron, sorry for the late response.
I just realized it looks like you have multiple cursors in your screenshot, something we don't currently handle. If this is something you would like to improve, I would be interested in a way to handle that if you sent a PR.
Otherwise, my take is that for individual cursor selections the way things work now are consistent with Jupyter platforms that separate output by cells. The intended way to get multiple outputs in hydrogen is to include cell markup in your code file.
https://nteract.gitbooks.io/hydrogen/docs/Usage/GettingStarted.html#hydrogen-run-cell
@BenRussert As an example, I often want to debug functions for which I have default values, and my ideal way of initially defining those values would be like this:
This isn't really a situation where run-cell
would be useful, because only occasionally do I want to run the multiple selections, and it would seem that run-cell
would run the entire function, not the localized selections.
I'm guessing that the best way to implement this would be by changing codeManager.findCodeBlock()
?
https://github.com/nteract/hydrogen/blob/9d595258c9619b3b106b796c7b1305e3109bcf9e/lib/code-manager.js#L301-L312
If multiple selections are highlighted, run each of them sequentially. I.e. instead of:
It would be: