} else if (isBracelessBlockStart(d, c.offset, start)) { buf.append(createIndent(1, useSpaces()));
	private void smartIndentAfterNewLine(IDocument d, DocumentCommand c) {		int docLength= d.getLength();		if (c.offset == -1 || docLength == 0)			return;		try {			int p= (c.offset == docLength ? c.offset - 1 : c.offset);			int line= d.getLineOfOffset(p);			StringBuffer buf= new StringBuffer(c.text);			if (c.offset < docLength && d.getChar(c.offset) == '}') {				int indLine= findMatchingOpenBracket(d, line, c.offset, 0);				if (indLine == -1) {					indLine= line;				}				buf.append(getIndentOfLine(d, indLine));			} else {				int start= d.getLineOffset(line);				ITypedRegion region= TextUtilities.getPartition(d, fPartitioning, start);				if (region != null && IJavaPartitions.JAVA_DOC.equals(region.getType()))					start= d.getLineInformationOfOffset(region.getOffset()).getOffset();				int whiteend= findEndOfWhiteSpace(d, start, c.offset);				int length= whiteend - start;				buf.append(d.get(start, length));				if (getBracketCount(d, start, c.offset, true) > 0) {										buf.append(createIndent(1, useSpaces()));										if (fHasTypedBrace && closeBrace() && !isClosed(d, c.offset, c.length)) {						c.caretOffset= c.offset + buf.length();						c.shiftsCaret= false;												// copy old content of line behind insertion point to new line						// unless we think we are inserting an anonymous type definition						IRegion reg= d.getLineInformation(line);						int lineEnd= reg.getOffset() + reg.getLength();						if (!(computeAnonymousPosition(d, c.offset - 1, fPartitioning, lineEnd) != -1)) {							int contentStart= findEndOfWhiteSpace(d, c.offset, lineEnd);							if (lineEnd - contentStart > 0) {								c.length=  lineEnd - c.offset;								buf.append(d.get(contentStart, lineEnd - contentStart).toCharArray());							}						}											buf.append(getLineDelimiter(d));						buf.append(d.get(start, length));						buf.append('}');					}				}			}			c.text= buf.toString();		} catch (BadLocationException e) {			JavaPlugin.log(e);		}	}