Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

No newline created when text already on next line #5

Closed
kbrose opened this issue Feb 20, 2016 · 2 comments
Closed

No newline created when text already on next line #5

kbrose opened this issue Feb 20, 2016 · 2 comments

Comments

@kbrose
Copy link
Contributor

kbrose commented Feb 20, 2016

Create a python file that has three lines:

l = [0, 1, 2, 3]
l2 = map(
x = 1.0

Hit enter on the second line, after map(, and instead of creating a new line with the proper indentation, the line containing x = 1.0 is indented and no newline is created.

Using python indent version 0.3.3, Atom version 1.5.3

@DSpeckhals
Copy link
Owner

Thanks for the example. There is some improvement still that can be done to make the hanging indentation behavior better; this is a good start. I'll push out the change that fixes this soon.

Another thing that is a little more complicated is what Atom does with bracket matching in this situation.

Take this example:

def test_this(<cursor here>)

Which places the closing paren like this:

def test_this(
    <cursor here>
)

This is because Atom's bracket matching package is trying to be clever. It's not so good for Python. I'm not sure if the bracket-matcher needs fixed in Python, or if I can shim it in this package (which is what I was trying to do with the bug you're experiencing). I think just doing what you're suggesting is the best for now.

@kbrose
Copy link
Contributor Author

kbrose commented Feb 21, 2016

Thanks for the quick turn-around! I've noticed some other stuff going on that I hope to log as issues soon, but by no means do I just wish to dump a bunch of work in your lap. I haven't programmed in JS or coffeescript before, but I would be willing to give a shot at doing some PRs.

DSpeckhals added a commit that referenced this issue Feb 21, 2016
Well, I pulled your branch, used it a bit, and ran the tests, and all seems to be good. Good thinking! I'll merge this, and push out a release along with the changes I made for #5 sometime this week. This fixes #6.

Thanks for the PR!
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants