selection.setSelection(selectionStart.getLineInfo(), selectionStart.getColumn(),
selectionEnd.getLineInfo(), selectionEnd.getColumn());
}
// 4) Replace selection
EditorDocumentMutator mutator = editor.getEditorDocumentMutator();
if (selection.hasSelection() || autocompletionText.length() > 0) {
mutator.insertText(selectionStart.getLine(), selectionStart.getLineNumber(),
selectionStart.getColumn(), autocompletionText);
}
// 5) Move cursor / set final selection
selectionEnd = getPosition(selectionStart, jumpLength);