Open jmbuhr opened 3 months ago
Another potential solution is to check if a buffer is hidden in slime#targets#neovim#SlimeAddChannel
before
let jobid = getbufvar(buf_in, "&channel")
and do nothing if this is the case. This prevents the error for plugins that create hidden terminals.
@jam1015 ^
commented on PR #421, recommending merge.
making this autocommand optional would require slightly in-depth changes. For now I recommend both g:slime_suggest_default = 0
and g:slime_menu_config = 0
; that will remove the possibility of buffers that you don't want to send to's being suggested. working on a fix to SlimeClearChannel
analogous to the PR.
Would you be open to making the creation of this autocommand optional? As it also triggers on other terminal buffers that are not intended as a repl, like e.g. the terminal buffers created by neotest (https://github.com/nvim-neotest/neotest) to run tests or the terminal to run the preview command for quarto-nvim (https://github.com/quarto-dev/quarto-nvim/).
https://github.com/jpalardy/vim-slime/blob/51aaece8f7858358ca365466dec96c53b479e77a/plugin/slime.vim#L43-L49
In the case of neotest, this then leads to
the first time a test is run.
slime#targets#neovim#SlimeAddChannel(expand('<abuf>'))
could then be called manually on the creation of terminal intended for receiving code.