Skip to content
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

Unable to run code blocks that are already indented #1285

Closed
tobiasbj opened this issue Apr 9, 2018 · 3 comments
Closed

Unable to run code blocks that are already indented #1285

tobiasbj opened this issue Apr 9, 2018 · 3 comments

Comments

@tobiasbj
Copy link

tobiasbj commented Apr 9, 2018

Description:

Unable to run code blocks that are already indented.
Example is shown below.

Steps to Reproduce:

  1. Copy paste this code.
for i in range(10):  # This is the line you ignore
    test = "test"
    if test is None:
        print("yes")
    else:
        print("no")
  1. Mark and run all lines except the initial one.

Versions:

Windows 10
Atom 1.25.1
Hydrogen 2.3.0

Logs:
Error output

File "<ipython-input-1-ec679601011f>", line 2
    if test is None:
    ^
IndentationError: unexpected indent
@nikitakit
Copy link
Contributor

Have you tried installing hydrogen-python? (see also #862)

A short summary of what is going on here: hydrogen is designed to be language-agnostic, so its ability to understand indentation behavior specific to Python is limited in some ways. So far there hasn't been consensus on how to handle multi-line indented blocks in a language-agnostic manner, which led to the creation of a plugin that tries to address this issue specifically for Python.

@tobiasbj
Copy link
Author

tobiasbj commented Apr 9, 2018

Ah, cool. No I haven't tried hydrogen-python yet. I'll try it now 👍

@BenRussert
Copy link
Member

Looks like this was fixed in #1363, try this again after you update hydrogen. Feel free to reply if you still face the issue after updating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants