void () { init("ab<caret>cdef", PlainTextFileType.INSTANCE); EditorEx editorEx = (EditorEx)getEditor(); editorEx.setStickySelection(true); editorEx.getCaretModel().moveCaretRelatively(2, 0, false, false, false); CodeInsightSettings settings = CodeInsightSettings.getInstance(); boolean oldValue = settings.SURROUND_SELECTION_ON_QUOTE_TYPED; settings.SURROUND_SELECTION_ON_QUOTE_TYPED = true; try { type('\''); } finally { settings.SURROUND_SELECTION_ON_QUOTE_TYPED = oldValue; } checkResultByText("ab'<selection>cd</selection>'ef"); }