vim-slime icon indicating copy to clipboard operation
vim-slime copied to clipboard

E471: Argument required

Open ubaldot opened this issue 2 years ago • 11 comments

I am running Vim 8.2 on Windows 10. The command :SlimeSendCurrentLine works well, but the :SlimeSend, :SlimeSend0 and :SlimeSend1 give me the error E471: Argument required.

The only things related to vim-slime on my .vimrc are the following:

let g:slime_python_ipython = 1
let g:slime_target = "vimterminal"
let g:slime_cell_delimiter = "# %%"

Any hint on how to fix the problem?

ubaldot avatar Apr 05 '22 17:04 ubaldot

Hi @Barzi2001

Do you know what line/function is causing a problem?

If you give me a step-by-step, I can try to reproduce (minx the windows 10 part)

jpalardy avatar Apr 05 '22 22:04 jpalardy

Actually all give me problems. You can try for example this:

# %%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

A = 3
B = 4
C = A + B

# %%

ubaldot avatar Apr 06 '22 08:04 ubaldot

Hi @Barzi2001

what I did:

  • new docker container, ubuntu:latest image
  • put (only) your config in .vimrc
  • install vim, ipython3, vim-slime
  • start vim, :terminal, ipython3

Screen Shot 2022-04-06 at 21 50 02

  • sent text with ctrl-c ctrl-c
  • picked existing terminal (no 1)

I skipped the imports, not sure it was relevant to this problem

jpalardy avatar Apr 07 '22 04:04 jpalardy

# ipython3 --version
7.13.0

🤔

if you have a better step-by-step, I'm willing to try that. It might be a problem with versions too.

A docker recipe would be appreciated, if possible. (or instructions for specific versions)

jpalardy avatar Apr 07 '22 04:04 jpalardy

OK! Perhaps for Windows users the best would be to work via Docker. I haven't a better step-by-step, I think that such a minimal example above should be enough.

Yeah, the ipython version may be a problem,

PS C:\Users\yt75534> ipython3.exe --version
7.22.0

ubaldot avatar Apr 07 '22 09:04 ubaldot

This certainly looks like it's breaking on the vim-slime side (rather than anything having to do with Windows and/or ipython)

:help e471 says

                                                        E471
  Argument required

This happens when an Ex command with mandatory argument(s) was executed, but
no argument has been specified.

which isn't exactly enlightening… 😐

If you want to sprinkle the plugin code with echom and let me know what you find, I can try to help.

jpalardy avatar Apr 08 '22 02:04 jpalardy

I am not sure I can use this feature, but I run :echom followed by :SlimeSend0 obtaining the same e471 error again with no more info (I also checked in :messages). I also tried to uninstall/reinstall the plugin but it didn't help.

Unrelated: every time I try to use vim-slime I have to run :SlimeConfig manual and select the target window of my slimes. I am aware that in specify a default terminal in my .vimrc, but what shall I write if I have a cryptical message like this? What is the terminal name and the session name?!

image

ubaldot avatar Apr 08 '22 15:04 ubaldot

Hi @Barzi2001

I use tmux because I can default to

let g:slime_target = "tmux"
let g:slime_default_config = {"socket_name": "default", "target_pane": "{last}"}
let g:slime_dont_ask_default = 1

and {last} "just works"…

if there's a vimscript way to inspect and (intelligently) pick the vim-terminal … it's not part of the plugin 😩

jpalardy avatar Apr 09 '22 02:04 jpalardy

UPDATE: If I run e.g. :SlimeSend0 1000, then 1000 is "slimed" to the REPL. I am not sure, but it seems the argument to be passed to :SlimeSend0 is what is in between the delimiters (# %% in my case) and it seems that the command :SlimeSend0 simply fails at picking it?

ubaldot avatar Apr 11 '22 09:04 ubaldot

:SlimeSend0 and :SlimeSend1 are not overly publicized. They take strings as argument and directly send those over (no relation to buffer content or selection)

jpalardy avatar Apr 13 '22 02:04 jpalardy

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 13 '22 06:08 stale[bot]