dccsillag / magma-nvim

Interact with Jupyter from NeoVim.
GNU General Public License v3.0
977 stars 49 forks source link

`MagmaEvaluateRange` vim function #109

Closed benlubas closed 4 months ago

benlubas commented 11 months ago

Adds MagmaEvaluateRange to address #108 and partially address #19

For an example of why this is useful, I use it here to run all the code cells above the cursor in a qmd document.

From the README:

Functions

There is a provided function MagmaEvaluateRange(start_line, end_line) which evaluates the code between the given line numbers (inclusive). This is intended for use in scripts.

Example Usage:

vim.fn.MagmaEvaluateRange(1, 23)
MagmaEvaluateRange(1, 23)
" from the command line
:call MagmaEvaluateRange(1, 23)
benlubas commented 11 months ago

@WhiteBlackGoose I have a couple small quality of life PRs (like this one) up now, would appreciate if you have time to look at them this weekend.

I also have a large draft PR that improves images and showing output. It's still a work in progress, but I'd like some feedback on how a large and potentially breaking change like that should be handled.