EA-235769 // StringIndexOutOfBoundsException

https://ea.jetbrains.com/browser/ea_problems/235769
This commit is contained in:
Andrei Klunnyi
2020-07-21 16:56:59 +02:00
parent 4afa50e081
commit c27453632e
@@ -76,7 +76,7 @@ class KotlinLiteralCopyPasteProcessor : CopyPastePreProcessor {
while (givenTextOffset < fileRange.endOffset) {
val element: PsiElement? = file.findElementAt(givenTextOffset)
if (element == null) {
buffer.append(fileText.substring(givenTextOffset, fileRange.endOffset))
buffer.append(fileText.substring(givenTextOffset, fileRange.endOffset - 1))
break
}
val elTp = element.node.elementType