How do you end this indentation line?

Like shown in the screenshots, Atom seems not to end those indentation lines even if there is no indentation on the certain line. Is there a way to make Atom end those when the certain function is ended?

Not an easy one, because Atom would need to be able to tell when the function ends. It does with JavaScript and C++, because functions are clearly enclosed in brackets, but that’s not an option in Python so there’s no clear “this function should end now” signal except for the line where the next section of unindented code begins. Notice that there’s no indentation on line 25, but you still want the line to continue to the return statement. It’s not easy to tell Atom how to tell the difference between line 25 and line 27, so it behaves the same way on each.

The new Tree-sitter grammars probably have the capability to do it, but I don’t know if Atom’s indentation guide setup has the capability to adapt what it’s doing even if something’s there to tell it when the function actually ends.

1 Like

Thank you for your reply !

I searched for some packages, and I found a solution.
The “indent-guide-improved” package did the job! No more unnecessary indent lines!

1 Like

Glad you found something that worked.