CPP-3103: "Use tabs" option support
authorAlexey Utkin <alexey.utkin@jetbrains.com>
Fri, 22 May 2015 16:06:30 +0000 (19:06 +0300)
committerAlexey Utkin <alexey.utkin@jetbrains.com>
Fri, 22 May 2015 16:09:04 +0000 (19:09 +0300)
platform/lang-impl/src/com/intellij/formatting/FormatProcessor.java

index 2858009356af88925637cf6be4d1a15e43aa4652..7c854cf267d97f3fe055f9e9089542d767dbcb01 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2015 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.
@@ -1274,12 +1274,7 @@ class FormatProcessor {
                                @NotNull final CommonCodeStyleSettings.IndentOptions options)
   {
     if (oldIndent.equals(newIndent)) return 0;
-    if (options.USE_TAB_CHARACTER) {
-      return (newIndent.tabs - oldIndent.getTabsCount(options)) * options.TAB_SIZE;
-    }
-    else {
-      return newIndent.whiteSpaces - oldIndent.getSpacesCount(options);
-    }
+    return newIndent.getSpacesCount(options) - oldIndent.getSpacesCount(options);
   }
 
   /**