Damn I hate these small summary fields. I also hate the auto-inserted word-wrap in these text fields, BTW. Anyway, this might be a dupe of some of the other several auto-indent bugs, but I took some time to look at this one and have a good idea of what's going on (though I haven't looked at how to fix it just yet). The problem is with a piece of code like this, for example (in a mode like C or Java): if (foo) bar; for (;;) { As soon as you hit "{" the line will be indented to the same level as "bar;", which is wrong. This is because in JEditBuffer.java:getIdealIndentForLine(), "oldIndent" is initialized to the indent size of the last non-empty line. In this case this is wrong, since the last non-empty line is at a different indent level than the current indent line. The code needs to check what's the auto-indent level for the next line after the last non-empty line, instead of just using the same indent level.