From 0ccb155cae91da9d475ea5f5269d38774bae0c58 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Mon, 15 Nov 2010 17:55:38 +0300 Subject: [PATCH] generate xml tag in the right position (related to IDEA-60787) --- xml/impl/src/com/intellij/xml/actions/GenerateXmlTagAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/impl/src/com/intellij/xml/actions/GenerateXmlTagAction.java b/xml/impl/src/com/intellij/xml/actions/GenerateXmlTagAction.java index 727b7bd52832..303015b731ed 100644 --- a/xml/impl/src/com/intellij/xml/actions/GenerateXmlTagAction.java +++ b/xml/impl/src/com/intellij/xml/actions/GenerateXmlTagAction.java @@ -101,7 +101,7 @@ public class GenerateXmlTagAction extends SimpleCodeInsightAction { Document document = editor.getDocument(); document.insertString(offset, newTag.getText()); PsiDocumentManager.getInstance(getProject()).commitDocument(document); - newTag = PsiTreeUtil.getParentOfType(file.findElementAt(offset), XmlTag.class, false); + newTag = PsiTreeUtil.getParentOfType(file.findElementAt(offset + 1), XmlTag.class, false); } else { newTag = (XmlTag)contextTag.addAfter(newTag, anchor);