Fix: IDEA-67827 (Smarter completion of tags)

This commit is contained in:
Sergey Evdokimov
2011-04-18 12:01:15 +04:00
parent 77babea36c
commit 1264499e88
@@ -285,12 +285,12 @@ public class XmlTagInsertHandler implements InsertHandler<LookupElement> {
return true;
}
}
else if (completionChar == Lookup.AUTO_INSERT_SELECT_CHAR || completionChar == Lookup.NORMAL_SELECT_CHAR) {
else if (completionChar == Lookup.AUTO_INSERT_SELECT_CHAR || completionChar == Lookup.NORMAL_SELECT_CHAR || completionChar == Lookup.REPLACE_SELECT_CHAR) {
if (WebEditorOptions.getInstance().isAutomaticallyInsertClosingTag() && HtmlUtil.isSingleHtmlTag(tag.getName())) {
template.addTextSegment(tag instanceof HtmlTag ? ">" : "/>");
}
else {
if (needAlLeastOneAttribute(tag) && WebEditorOptions.getInstance().isAutomaticallyStartAttribute()) {
if (needAlLeastOneAttribute(tag) && WebEditorOptions.getInstance().isAutomaticallyStartAttribute() && tag.getAttributes().length == 0) {
completeAttribute(template);
return true;
}