Open rkrisztian opened 8 years ago
+1 same here, took me 1 hour to figure out.
+1
And here I thought I was going mad, when I found nothing that explained this in the IDEA Bug Tracker.
I'll probably just remove indent_size
everywhere for now, since this breaks a lot of java code style.
I found that the IDEA-specific setting continuation_indent_size = 8
helped.
I think that this issue is mostly fixed, however when using indent_style = tab
, there is no way to set continuation_indent_size
without defining how wide a tab character is. One of the benefits of using the tab character is that anyone can choose what they want the width of the tab character to be.
It would be nice if we could have something like this: continuation_indent_size = tab_width * 2
, or something along that line.
Hi,
IDEA supports the concept of continuation indent. Its size is usually configured to twice as much as the regular indent size. Continuation indent can occur if e.g. you wrap the first line of an "if" or "for" or "try" statement in Java (and others like variable assignments, etc.). Continuation indent can also increase readability. Consider a line wrapped just before a block start in the case you use K&R style braces, and you don't wrap the lines around the parentheses. Then without a different indentation, it is hard to see whether the next line belongs to the block, or still to first line of the statement. And the EditorConfig plugin forces us to use the same indentation setting for continuation indentation as for regular indentation.
Example Java code without the EditorConfig support:
Example Java code with the EditorConfig support enabled:
I believe this is a bug of the plugin, and a decent fix may need a co-operation between the EditorConfig developers to add support for continuation indent (it is somewhat language specific though).