input.replaceTextRange(insertPos, 0, insertCode);
input.setCaretOffset(insertPos + 1);
}
});
// prevent selected text from disappearing when you hit enter
input.addExtendedModifyListener(new ExtendedModifyListener() {
public void modifyText(ExtendedModifyEvent e) {
String text = ((StyledText) e.widget).getText();
if (text.contains("" + SWT.CR))
((StyledText) e.widget).setText((text.substring(0,