From ddc1657b35d36e9deee1210eac88570d463b0d93 Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Fri, 30 Sep 2016 10:44:19 +0300 Subject: [PATCH] EA-89190 - ISE: EditorView.offsetToVisualPosition --- .../editorActions/PasteHandler.java | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/PasteHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/PasteHandler.java index 034061594327..fe26760782bd 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/PasteHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/PasteHandler.java @@ -313,21 +313,12 @@ public class PasteHandler extends EditorActionHandler implements EditorTextInser private static void reformatBlock(final Project project, final Editor editor, final int startOffset, final int endOffset) { PsiDocumentManager.getInstance(project).commitAllDocuments(); - Runnable task = () -> { - PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); - try { - CodeStyleManager.getInstance(project).reformatRange(file, startOffset, endOffset, true); - } - catch (IncorrectOperationException e) { - LOG.error(e); - } - }; - - if (endOffset - startOffset > 1000) { - DocumentUtil.executeInBulk(editor.getDocument(), true, task); + PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); + try { + CodeStyleManager.getInstance(project).reformatRange(file, startOffset, endOffset, true); } - else { - task.run(); + catch (IncorrectOperationException e) { + LOG.error(e); } }