String indent= getIndent(document, command);
String blockIndent= getBlockIndent(document, command); String insideBlockIndent= blockIndent == null ? "" : blockIndent + createIndent(1); String previousIndent= getIndent(document, command); String indent= calculateDisplayedWidth(insideBlockIndent) < calculateDisplayedWidth(previousIndent) ? insideBlockIndent : previousIndent;
	protected void smartPaste(IDocument document, DocumentCommand command) {		String lineDelimiter= getLineDelimiter(document);		try {			String pastedText= command.text;			Assert.isNotNull(pastedText);			Assert.isTrue(pastedText.length() > 1);			String strippedParagraph= stripIndent(pastedText, lineDelimiter);			// check selection			int offset= command.offset;			int line= document.getLineOfOffset(offset);			int lineOffset= document.getLineOffset(line);			// format			String prefix= document.get(lineOffset, offset - lineOffset);			String indent= getIndent(document, command);			boolean formatFirstLine= prefix.trim().length() == 0;			String formattedParagraph= format(strippedParagraph, indent, lineDelimiter, formatFirstLine);			// paste			if (formatFirstLine) {				int end= command.offset + command.length;				command.offset= lineOffset;				command.length= end - command.offset;			}			command.text= formattedParagraph;		} catch (BadLocationException e) {			JavaPlugin.log(e);		}	}