commit | 1c69eb5c11022194f58738eb2941a0cbc05fe228 | [log] [tgz] |
---|---|---|
author | Christof Marti <cmarti> | Tue Oct 26 09:12:09 2004 +0000 |
committer | Christof Marti <cmarti> | Tue Oct 26 09:12:09 2004 +0000 |
tree | 63c5fae65ba205e22cb0175f9a064772b5a37f50 | |
parent | 77b37f680bc187c8bb4fc971de2164595e284f47 [diff] |
fix for comments with non-whitespace before their start on same line
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/comment/CommentFormattingStrategy.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/comment/CommentFormattingStrategy.java index 1d252b3..4eb6b24 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/comment/CommentFormattingStrategy.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/comment/CommentFormattingStrategy.java
@@ -150,17 +150,16 @@ int level= 0; for (int i= 0, n= reference.length(), spaces= 0; i < n; i++) { char ch= reference.charAt(i); - if (ch == ' ') { + if (ch == '\t') { + spaces= 0; + level++; + } else { spaces++; if (spaces >= tabSize) { spaces= 0; level++; } - } else if (ch == '\t') { - spaces= 0; - level++; - } else - throw new IllegalArgumentException(); + } } return level; }