Closed Henderake closed 1 year ago
Hi @Henderake
Thanks for the PR 👍
Since this is x11-specific, and probably application-specific, I'm not sure how generic this fix is.
Can you experiment with overrides and check if you can make it work for your use case?
Thanks for the guide. I've managed to use overrides in my .vimrc to solve it, so I'll close the PR.
let g:slime_x11_lf_to_cr = 1
function! SlimeOverride_EscapeText_python(text)
let escaped_text = _EscapeText_python(a:text)
if g:slime_target =~ "x11" && exists("g:slime_x11_lf_to_cr") && g:slime_x11_lf_to_cr
return substitute(escaped_text, '\n', '\r', 'g')
end
return escaped_text
endfunction
While using
vim-slime
with Jupyter QtConsole on Windows WSL, I experienced a multi-line issue similar to the one discussed in https://github.com/jpalardy/vim-slime/issues/297. Upon further investigation, it was discovered that these X11 applications do not break the lines on\n
but rather on\r
. This pull request introduces a new configuration variableg:slime_x11_lf_to_cr
, enabling the substitution of\n
with\r
specifically when the target is X11.