summaryrefslogtreecommitdiff
path: root/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/MoreOperationNode.java
diff options
context:
space:
mode:
Diffstat (limited to 'xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/MoreOperationNode.java')
-rw-r--r--xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/MoreOperationNode.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/MoreOperationNode.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/MoreOperationNode.java
index fa8021565511..0a1bea140d6b 100644
--- a/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/MoreOperationNode.java
+++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/nodes/MoreOperationNode.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2010 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@ import com.intellij.codeInsight.template.CustomTemplateCallback;
import com.intellij.openapi.util.text.LineTokenizer;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
@@ -49,6 +50,12 @@ public class MoreOperationNode extends ZenCodingNode {
return ContainerUtil.newLinkedList(myLeftOperand, myRightOperand);
}
+ @Override
+ public int getApproximateOutputLength(@Nullable CustomTemplateCallback callback) {
+ int mul = myLeftOperand instanceof MulOperationNode ? ((MulOperationNode)myLeftOperand).getRightOperand() : 1;
+ return myLeftOperand.getApproximateOutputLength(callback) + (myRightOperand.getApproximateOutputLength(callback) * mul);
+ }
+
@NotNull
@Override
public List<GenerationNode> expand(int numberInIteration,