From aec833ce3447e83ab05fc801b7a927c2b5042e5e Mon Sep 17 00:00:00 2001 From: "Denis.Zhdanov" Date: Tue, 10 Apr 2012 11:38:03 +0400 Subject: [PATCH] EA-34555 - AE: IndentHelperImpl.getIndent --- .../psi/impl/source/codeStyle/IndentHelperImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/IndentHelperImpl.java b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/IndentHelperImpl.java index 18f3ec30b53b..3098622d0655 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/IndentHelperImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/IndentHelperImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -157,7 +157,11 @@ public class IndentHelperImpl extends IndentHelper { if (tabCount == 0) return spaceCount; int tabSize = settings.getTabSize(fileType); - int indentLevel = tabCount * tabSize / settings.getIndentSize(fileType); + int indentSize = settings.getIndentSize(fileType); + if (indentSize <= 0) { + indentSize = 1; + } + int indentLevel = tabCount * tabSize / indentSize; return indentLevel * INDENT_FACTOR + spaceCount; } }