Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autoindentation of a new line in Eclipse - how to disable?

This seems to be a FAQ question, because I know what the corrent answer should be for setting up indentation for Java code in Eclipse (Windows -> Preferences -> Java -> Code Style -> Formatter), but I can't find exactly an option which leads to the following behaviour, which I want to disable.

The problem: every time I press Enter after some text on a line, editor moves text cursor not under the beginning of the previous line, but adds one level of indentation. How can this be disabled in Indigo? I need that every new line is started from a position from which the source line above starts. I tried a lot of controls in the formatter preferences - nothing helped so far. Perhaps I've missed something.

like image 848
Stan Avatar asked May 12 '12 19:05

Stan


1 Answers

I found this: Preferences -> Java -> Editor -> Typing, the checkbox Enter key adjusts the indentation on the new line. (This tab provides editor with extra intelligence apart from formatter and works on the fly. It may be helpful to tweak some of these options depending from personal coding practicies.)

Unfortunately, when this checkbox is off, the editor stops to add paired curly braces even if the options Automatically insert at correct position: braces and Automatically close {Braces} are both on. I don't undertand why the indentation option affects braces, and actually disables this very handy mode.

P.S. Smart insert mode is on as well.

like image 196
Stan Avatar answered Sep 30 '22 04:09

Stan