Atom isn't automatically indenting empty lines of code?


#1

Here is an example of a function I’m trying to define:

def prompting():
    a = int(input("a: "))
    b = int(input("b: "))
    c = int(input("c: "))
    n = int(input("n: "))

    check_fermat(a, b, c, n)

When I first ran it, I got an indentation error. However, when I went to the empty line in my function body, and spaced it twice, the error went away. Why isn’t Atom auto indenting line breaks? How do I fix this?


Atom Still Deleting Lines of Code Disabling Whitespace?
#2

Atom does, and then the whitespace package removes them. You can change the whitespace settings to prevent it from removing trailing whitespace or ignore lines that only have whitespace.


#3

This didn’t solve my problem. Even if whitespace is disabled, atom will still delete extra lines in my python script when saving. I played with these settings countless times and it still doesn’t resolve the issue.


#4

Recently I had a similar issue (not Python). What @DamnedScholar suggests was what I had to do. Indeed very strange.

Perhaps it is another package that is interfering? If you code when Atom is in safe mode, do you still have this happening?


#5

Oh sorry, this was solved. I was thinking of a nother question I asked regarding a different issue.