How to stop Intellij from automatically changing the indentation in lines that were not edited?

I work on many projects in Intellij where the formatting is bad or unorthodox, especially where the indentation of the “continue” lines seems to differ from how Intellij is configured. I don’t want to correct this indentation for many files or even for the whole file (this is contrary to our technical team policy, because it will destroy git-blame, and also because it will lead to noise differences or extraneous recordings)

If I edit a file with such indentation, I am very good at Intellij with auto-inducing new lines of code or lines that I edited. But I often find that he separated OTHER lines elsewhere in the file, almost always these lines are "continue" *

How to configure Intellij to stop their change? There is a configuration option to remove trailing spaces only in lines that have been changed, but I cannot find where the configuration controls this behavior. FWIW this does not happen when saving, but it seems to happen after some other trigger, but I'm not sure what a trigger is. I think this can happen when you automatically import classes?

* I think they are called, for example:

foo.bar() .baz() // a line that might be changed by Intellij

+4
source share
3 answers

, , IntelliJ IDEA , Code | Reformat Code ( , Ctrl-Alt-L Option-Command-L, dnault). , , . ( , , , .)

, VCS | | "" ( " ", ). . .

( | ) | | Java, ( " " ). , .

( " , ", , "": " | ", "", " " ".)

+1

" ". , , , , . , : | ( Intel IDE)

0

. IntelliJ , , . . , , ( ) - .

, , ( , ).

0

Source: https://habr.com/ru/post/1618170/


All Articles