diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillToWordEndActionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillToWordEndActionTest.java index 31b8aaae3de5..8217a6c165de 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillToWordEndActionTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillToWordEndActionTest.java @@ -15,6 +15,9 @@ */ package com.intellij.openapi.editor.actions; +import com.intellij.openapi.editor.Document; +import com.intellij.openapi.editor.impl.CaretModelImpl; +import com.intellij.openapi.editor.impl.EditorImpl; import com.intellij.openapi.ide.CopyPasteManager; import com.intellij.openapi.ide.KillRingTransferable; import com.intellij.testFramework.LightPlatformCodeInsightTestCase; @@ -121,4 +124,21 @@ public class KillToWordEndActionTest extends LightPlatformCodeInsightTestCase { Object string = contents.getTransferData(DataFlavor.stringFlavor); assertEquals("first second", string); } + + public void testDoubleEditors() throws Exception { + String text = "first second third"; + configureFromFileText(getTestName(false) + ".txt", text); + final Document document = myEditor.getDocument(); + final CaretModelImpl caretModel = new CaretModelImpl((EditorImpl)myEditor); + document.addDocumentListener(caretModel); + caretModel.moveToOffset(document.getTextLength()-1); + killToWordEnd(); + killToWordEnd(); + checkResultByText(" third"); + + Transferable contents = CopyPasteManager.getInstance().getContents(); + assertTrue(contents instanceof KillRingTransferable); + Object string = contents.getTransferData(DataFlavor.stringFlavor); + assertEquals("first second", string); + } }