- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visual selection sent and evaluated line-by-line rather than as a chunk #378
Comments
I don't mean to hijack this thread, but it's probably related: I also have an issue with visual_send in python. In my case, it's sent in one piece, but the indentation gets messed up. My source code: for i in range(2):
print (i)
print (i+1) After selecting and visual_send: In [286]: for i in range(2):
...: print (i)
...: print (i+1)
Cell In[286], line 3
print (i+1)
^
IndentationError: unexpected indent If I manually yank and paste these lines into the REPL, there's no issue. For me, the config is repl_definition = {
python = { command = 'ipython --nosep' },
} (Don't hesitate to ask me to open a new issue if it's bothering here) |
@rwijtvliet . I use the command 'ipython --no-autoindent'. its the ipython default in iron. so my config looks like this
i don't know the difference between --nosep and --no-autoindent but maybe thats your issue. |
Ah, thank you! That actually cleared up my issue 🙏 FYI, the So the issue you're describing, that visual_send() sends each line separately, I cannot confirm. What I do see is that sending a chunk of code, such as I'll sit this one out and not pollute the thread again. |
The issue was solved when i reverted back before those updates i listed. Today when i brought it all up to date again, along with other packages, the issue was gone. iron hasn't been updated since then, so the issue must have come from somewhere else. I'm closing the issue. |
Actually, my bad. The issue is not closed and i've found what the issue is. iron.fts.common.bracketed_paste_python doesn't work well for ipython. so in commit (#367) when the default format for ipython was changed from bracketed_paste to bracketed_paste_python, something stopped working. my workaround is to use the following configuration:
i dont know lua well enough to figure out why bracketed_paste_python doesn't work for ipython on linux. So im reopening the issue in case someone want's to figure this out. |
@marbris Hey I am using
Can you show me a snippet of code that you are having issues with? |
class LSTMForVariableInput(nn.Module):
In Iron.vim In [72]: class LSTMForVariableInput(nn.Module): In [73]: self.lstm = nn.LSTM(
|
@Jynxzzz Sorry I made a mistake in the configuration that I asked you to try.
I just tested this on linux an it worked. |
Man it worked like a magic. Thank you for your insane quick reply and huge help! ! |
@Jynxzzz youre welcome! |
When i select a chunk of python code and send it to repl using iron.core.visual_send() it sends each line to the repl and evaluates it before sending the next line. It will send the next line even if an error is thrown along the way and it makes debugging difficult. A few weeks ago it would send and evaluate the selection as a whole.
Edit: I'm using LazyVim on Ubuntu 22.04. Iron.nvim is configured for python with
This changed over the past few weeks. it's probably one of the following updates but i can't tell which one it would be:
EDIT:
the issue is that
format = iron.fts.common.bracketed_paste_python
doesn't work well with ipython. the default was changed frombracketed_paste
tobracketed_paste_python
in commit #367 . the workaround is to explicitly set thebracketed_paste
, shown below. I don't know lua well enough to figure out why it doesn't work.The text was updated successfully, but these errors were encountered: