Skip to content

Commit

Permalink
fix: automatic r/python switching with reticulate
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbuhr committed Feb 26, 2024
1 parent a9ee42d commit bd548bf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lua/plugins/quarto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -655,10 +655,14 @@ return {
let g:slime_dispatch_ipython_pause = 100
function SlimeOverride_EscapeText_quarto(text)
call v:lua.Quarto_is_in_python_chunk()
if exists('g:slime_python_ipython') && len(split(a:text,"\n")) > 1 && b:quarto_is_python_chunk || (exists('b:quarto_is_r_mode') && !b:quarto_is_r_mode)
if exists('g:slime_python_ipython') && len(split(a:text,"\n")) > 1 && b:quarto_is_python_chunk && !(exists('b:quarto_is_r_mode') && b:quarto_is_r_mode)
return ["%cpaste -q\n", g:slime_dispatch_ipython_pause, a:text, "--", "\n"]
else
return a:text
if exists('b:quarto_is_r_mode') && b:quarto_is_r_mode && b:quarto_is_python_chunk
return [a:text, "\n"]
else
return [a:text]
end
end
endfunction
]])
Expand Down

0 comments on commit bd548bf

Please sign in to comment.