Closed jpalardy closed 1 month ago
Hi @jam1015
This paste_file
stuff had bothered me for a while.
It seems the last use is in the neovim target … and might not even be needed? 🤔
(or we use it for the wrong reason…)
Let me know if you think we can remove it.
Hi! After investigating and testing with a minimal config, I think you're good to get rid of this line. The paste file doesn't seem to be accessed anywhere.
The comment for it:
" Neovim jobsend is fully asynchronous, it causes some problems with
" iPython %cpaste (input buffering: not all lines sent over)
" So this `write_paste_file` can help as a small lock & delay
" call slime#common#write_paste_file(a:text)
indicates that it is used to introduce a small delay and that delay is introduced by the python ftplugin file when slime_python_ipython
is set. So maybe using the pastefile for this is a relic from a previous strategy used to introduce a delay.
Do you want me to take a stab at it?
I can code it, but I don't know how thorough my neovim tests will be 😅
Ok go ahead and make the changes you think are appropriate. The changes to be made in my opinion are just, deleting the call to call slime#common#write_paste_file(a:text)
and the comment explaining that call, and if its then not used anywhere else in the codebase, deleting the definition of that function. Once you've done that I can test that branch; my tests are just sending code to python/ipython/ptpython in neovim with g:slime_python_ipython
enabled and disabled.
Removed dependency on
g:slime_paste_file
by using STDIN with screenreadreg
.Advantages
It might break something, in which case I'll see if when need to support both STDIN and
g:slime_paste_file
related: #431