run_all_cell error: Invalid 'replacement string' item
I configured Molten as my REPL. When I call run_cell() or run_and_move() everything works as expected, but run_all_cells() fails with an error:
Error executing lua .../NotebookNavigator.nvim/lua/notebook-navigator/repls.lua:50: Invalid 'replacement string' item: expected String, got nil
stack traceback:
[C]: in function 'nvim_buf_set_lines'
.../NotebookNavigator.nvim/lua/notebook-navigator/repls.lua:50: in function 'repl'
...y/NotebookNavigator.nvim/lua/notebook-navigator/core.lua:128: in function 'run_all_cells'
...y/NotebookNavigator.nvim/lua/notebook-navigator/init.lua:110: in function 'run_all_cells'
[string ":lua"]:1: in main chunk
My plugin config:
opts = {
repl_provider = 'molten',
},
I assume that the problem is in core.lua: in function run_all_cells() on line 128 repl is called with 3 arguments, so this call omits cell_marker argument. In run_cell() on line 106 repl is called with all 4 arguments. The run_cell works in molten because line_count < (end_line + 1) condition (file repls.lua line 49) is false in this case. Iron repl doesn't use cell_marker argument at all. For Molten cell_marker only used in case of running all file.
I hacked a quick fix with drilling cell_marker from init.lua. It kinda solves the problem, but I'm not sure that it's a proper fix and the way how it supposed to work, because in this case a file is treated as one giant cell, so the whole output is packed after last line in a file.
What do you mean drilling cell_marker from init.llua? @IgorRain
What do you mean drilling cell_marker from init.llua? @IgorRain
Sorry for long response.
I mean that cell_marker is defined in init.lua and then used in repls.lua. So this argument is required to pass through the whole call chain. Current implementation doesn't do it. But just passing this argument leads to a weird behavior.