mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user