} else {
snippet = start + end;
}
if (snippet != null && snippet.length() > 0) {
Encloser encloser = new Encloser();
encloser.enclose(doc, (ITextSelection) sel, snippet, "");
// move the cursor to before the end of the new insert
int offset = ((ITextSelection) sel).getOffset();
offset += ((ITextSelection) sel).getLength();
offset += snippet.length();
if (i == 0) {