if (tagElement.getLastChild() instanceof PsiErrorElement) {
doInsertion = true;
}
else {
iterator = ((EditorEx)editor).getHighlighter().createIterator(0);
while (!iterator.atEnd() && iterator.getStart() < offset) {
if (iterator.getTokenType() == CfmlTokenTypes.CF_TAG_NAME) {
String currentTagName = document.getCharsSequence().subSequence(iterator.getStart(), iterator.getEnd()).toString();
if (tagName.equals(currentTagName)) {
PsiElement currentTagElement = file.findElementAt(iterator.getStart());
currentTagElement = PsiTreeUtil.getParentOfType(currentTagElement, CfmlTag.class);