Open ghost opened 8 years ago
I've got the same issue!
same here ... bpython works tho
I have this problem too! My only fault for an AWESOME plugin.
I did find though that exiting out of IPython to just a normal bash prompt, SlimuxREPLSendSelection DOES indeed send the selection only, however, after left clicking in the bash prompt pane (and hearing n -1 terminal beeps when copying over n lines). Just interesting...it DOES work, just not in the new IPython.
Same issue. Anyone find a workaround?
I found a workaround, but note that I haven't yet checked all corner cases. Here's a line that makes the visual selection mode work with Slimux in Ipython 5 for me, binding the command to <C-c><C-c>
(of course, you can bind it to any other shortcut):
vnoremap <C-c><C-c> :<C-w>SlimuxShellRun %cpaste<CR>:'<,'>SlimuxREPLSendSelection<CR>:SlimuxShellRun --<CR>
In short, the idea is to use the %cpaste magic to enter text. This has the added advantage that it probably works better with heavily indented code, although I haven't fully checked.
Here's what it does:
'<,'>
that vim automatically adds to command lines in visual selection mode%cpaste
'<,'>
--
to end the %cpaste
magicI just created a PR for adding an option to use %cpaste
One concern about %cpaste is it will not be saved in ipython's history. Checkout https://github.com/ipython/ipython/issues/1384
After some investigation, I found that
paste-buffer
support bracketed paste mode
via -p
option.I've created a PR accordingly: https://github.com/epeli/slimux/pull/75.
The main advantage of the paste
way is that the pasted content will be stored in ipython's history.
I have this on my work station but on my laptop it works just fine!
When the user sends a visual selection to a pane with IPython 5, slimux only sends the first line. Here is a screenshot the show the result after visual selection (selecting both lines) and
<C-c><C-c>
:By the way, excellent plugin.