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
basic config leads to python unexpected indent #348
Comments
UpdateA few things. First, it seems the More importantly, things work fine with I did some reading, and it seems that there is a lot of discussion about whether the default python repl should include "bracketed paste" as a feature:
I don't know exactly what to make of all this. But perhaps the specific version of python (either built or downloaded) may or may not include bracketed paste. If there is a simple solution I am not seeing please let me know. |
This comment was marked as outdated.
This comment was marked as outdated.
I have the same issue.
For example this code: def my_func():
matches = [1, 2, 3]
for match in matches:
print(match) Gives the following output: In [1]:
In [1]:
In [1]: def my_func():
...: matches = [1, 2, 3]
...: for match in matches:
...: print(match)
Cell In[1], line 3
for match in matches:
^
IndentationError: unexpected indent
In [2]: On my other laptop (Void Linux), this works with iPython not Python, on this The following is an example that doesn't work on either machine regardless of Click Medef split_into_tokens(html_text: str):
tokens = []
pattern = r"(?:<(h[1-6])>([^<]+)</\1>|([^<]+))"
matches = re.findall(pattern, html_text)
current_token = {}
for match in matches:
heading_level = match[0]
heading_text = match[1].strip()
other_text = match[2].strip()
if heading_level:
if current_token:
tokens.append(current_token)
current_token = {heading_level: heading_text, "p": ""}
elif other_text:
if current_token.get("p"):
current_token["p"] += "\n"
current_token["p"] += other_text
if current_token:
tokens.append(current_token)
return tokens I haven't been able to figure this out, for the moment, I'm using Fterm and Tmux / Zellij. |
@RyanGreenup I had the same issue, got the answer from this post So the config starts with this. The key difference being the iron.setup {
config = {
ignore_blank_lines = true, -- ignore blank lines when sending visual select lines
-- Whether a repl should be discarded or not
scratch_repl = true,
-- Your repl definitions come here
repl_definition = {
python = {
command = "ipython",
format = require("iron.fts.common").bracketed_paste,
}
},
-- How the repl window will be displayed
-- See below for more information
repl_open_cmd = require('iron.view').bottom(40),
},
|
I tried slime in the interim but I was having a similar issue. I tried the solution by @gnsiva and that seems to have solved it, although when I comment it back out the problem is entirely solved so 🤷 . |
hey @damca and @RyanGreenup , I believe this issue is fixed now. Could you try updating the plugin on your end to use the latest commit to master. I was having the same issue and the last PR for this plugin addressed it. This problem no longer exists on my end. |
I believe this is solved now, if this problem continues, please make another issue with an example that causes the same error. |
Behavior
Sending the following with visual send command (
<space>sc
):Leads to the following error:
This error persists even if
ignore_blank_lines = false
Setup
Using NVIM v0.9.1
I placed the
iron
directory in the runtime path~/.config/nvim/lua
, for simple testing.nvim -u NORC
:lua require('mytest')
The text was updated successfully, but these errors were encountered: