Geany editor: automatic indentation when there is an if/else statement

Hello,
when I try to write this script

sun = True
if sun:
    print("beach")
else:
    print("home")

it looks like this:

sun = True
if sun:
    print("beach")
    else:
        print("home")

I guess even with “auto indent” turned on, the editor can’t guess that there will be an “else:” statement after print(“beach”), so it doesn’t de-indent and I have to do it myself.
Am I right or wrong? Is there a particular way to make auto indent work in this case?

PS: Another way of looking at it: is there an editor capable of removing the indentation from “else:” when I press the “Enter” key to continue my script?

How would your editor know you want to write


if sun:
    print('beach')
else:
    print('home')

and not for instance

if sun:
    print(''beach')
    print('sunny')
else:
    print('home')

?

Since I know practically nothing about Python and even less about programming, I wanted to be sure I wasn’t missing anything.

Thank you very much for your reply.

Yes. VS Code, for example, behaves like this:

sun = True
if sun:
    print("beach")
    else  # when you type ':' here, it automatically de-indents one level

Which then becomes:

sun = True
if sun:
    print("beach")
else:

I found a .deb package that is an open source community version: codium_1.104.36664_amd64.deb. I’ll give it a try.
Thanks for the information.