From c27453632eaddc15ffdb5ecc59f7840d81ce3995 Mon Sep 17 00:00:00 2001 From: Andrei Klunnyi Date: Tue, 21 Jul 2020 16:56:59 +0200 Subject: [PATCH] EA-235769 // StringIndexOutOfBoundsException https://ea.jetbrains.com/browser/ea_problems/235769 --- .../kotlin/idea/editor/KotlinLiteralCopyPasteProcessor.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/editor/KotlinLiteralCopyPasteProcessor.kt b/idea/src/org/jetbrains/kotlin/idea/editor/KotlinLiteralCopyPasteProcessor.kt index c795c54ba8b..a2969d7fc26 100644 --- a/idea/src/org/jetbrains/kotlin/idea/editor/KotlinLiteralCopyPasteProcessor.kt +++ b/idea/src/org/jetbrains/kotlin/idea/editor/KotlinLiteralCopyPasteProcessor.kt @@ -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