void () { myFixture.configureByText(FileTypes.PLAIN_TEXT, "\"aaa\"\nbbb\n\n"); myFixture.getEditor().getCaretModel().moveToOffset(0); myFixture.getEditor().getSelectionModel().setSelection(0, 5); EditorActionManager.getInstance(); final TypedAction typedAction = TypedAction.getInstance(); performAction(myFixture.getProject(), () -> typedAction.actionPerformed(myFixture.getEditor(), '\'', ((EditorEx)myFixture.getEditor()).getDataContext())); myFixture.getEditor().getSelectionModel().removeSelection(); myFixture.checkResult("'aaa'\nbbb\n\n"); myFixture.getEditor().getCaretModel().moveToOffset(myFixture.getEditor().getDocument().getLineStartOffset(3)); performAction(myFixture.getProject(), () -> { typedAction.actionPerformed(myFixture.getEditor(), 'A', ((EditorEx)myFixture.getEditor()).getDataContext()); typedAction.actionPerformed(myFixture.getEditor(), 'B', ((EditorEx)myFixture.getEditor()).getDataContext()); }); myFixture.checkResult("'aaa'\nbbb\n\nAB"); }