mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed exception and inner function in copy-paste
This commit is contained in:
+5
-1
@@ -12,6 +12,7 @@ import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.util.text.CharArrayUtil;
|
||||
@@ -20,6 +21,7 @@ import java.awt.datatransfer.DataFlavor;
|
||||
import java.awt.datatransfer.Transferable;
|
||||
import java.awt.datatransfer.UnsupportedFlavorException;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
@@ -147,7 +149,9 @@ public class CopyPasteIndentProcessor implements CopyPastePostProcessor<IndentTr
|
||||
EditorActionUtil.indentLine(project, editor, startLine, -value.getFirstLineLeadingSpaces());
|
||||
}
|
||||
|
||||
if (caretColumn > value.getIndent()) endLine -=1;
|
||||
final List<String> strings = StringUtil.split(pastedText, "\n");
|
||||
if (caretColumn > value.getIndent() && !strings.isEmpty() &&
|
||||
StringUtil.isEmptyOrSpaces(strings.get(strings.size()-1))) endLine -=1;
|
||||
|
||||
for (int i = startLine+1; i <= endLine; i++) {
|
||||
EditorActionUtil.indentLine(project, editor, i, value.getIndent());
|
||||
|
||||
Reference in New Issue
Block a user