Search code examples
intellij-ideajetbrains-ide

How to disbale auto indent on key press on an empty line in Intellij IDEA?


Intellij IDEA applies auto indentation on empty lines.


For example, this:

••••thing.method()
••••••••

Becomes this after I insert a dot character:

••••thing.method()
••••.

And here's what I want to happen:

••••thing.method()
••••••••.

( represents the whitespace)


How do I disable this feature? I've disabled the "Smart indent", but it didn't help.

I'm using IntelliJ IDEA 2024.2.1


Here's what it looks like in action:

Intellij IDEA's unwanted auto indent behavior


Solution

  • What I needed to do was to change the value of the Continuation indent option in Editor > Code Style > Java.

    The formatter options are being applied as you type.


    Screenshot of the settings page of Intellij IDEA


    Thanks to LazyOne.