IDEA-77804 Incorrect indentation when pasting a line of Java code

Don't skip trailing line feeds of the pasted content anymore because that can affect processing of subsequent block
This commit is contained in:
Denis.Zhdanov
2011-12-07 16:06:26 +03:00
parent b6072cde41
commit 04e9880fd0
@@ -323,12 +323,8 @@ public class PasteHandler extends EditorActionHandler implements EditorTextInser
}
private static void indentEachLine(Project project, Editor editor, int startOffset, int endOffset) {
Document document = editor.getDocument();
CharSequence chars = document.getCharsSequence();
endOffset = CharArrayUtil.shiftBackward(chars, endOffset - 1, "\n\r") + 1;
PsiDocumentManager.getInstance(project).commitAllDocuments();
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(document);
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(project);
try {