replace sequences of spaces+tabs with single space
diff --git a/core/plugins/org.eclipse.dltk.formatter/src/org/eclipse/dltk/formatter/FormatterContext.java b/core/plugins/org.eclipse.dltk.formatter/src/org/eclipse/dltk/formatter/FormatterContext.java
index ca5b2aa..fc3a7d9 100644
--- a/core/plugins/org.eclipse.dltk.formatter/src/org/eclipse/dltk/formatter/FormatterContext.java
+++ b/core/plugins/org.eclipse.dltk.formatter/src/org/eclipse/dltk/formatter/FormatterContext.java
@@ -33,6 +33,7 @@
 
 	private int indent;
 	private boolean indenting = true;
+	private boolean comment = false;
 	private boolean wrapping = false;
 	private int blankLines = 0;
 	private final List path = new ArrayList();
@@ -90,6 +91,14 @@
 		this.indenting = value;
 	}
 
+	public boolean isComment() {
+		return comment;
+	}
+
+	public void setComment(boolean value) {
+		this.comment = value;
+	}
+
 	public int getBlankLines() {
 		return blankLines;
 	}
diff --git a/core/plugins/org.eclipse.dltk.formatter/src/org/eclipse/dltk/formatter/FormatterWriter.java b/core/plugins/org.eclipse.dltk.formatter/src/org/eclipse/dltk/formatter/FormatterWriter.java
index 57afe91..f4dea0c 100644
--- a/core/plugins/org.eclipse.dltk.formatter/src/org/eclipse/dltk/formatter/FormatterWriter.java
+++ b/core/plugins/org.eclipse.dltk.formatter/src/org/eclipse/dltk/formatter/FormatterWriter.java
@@ -254,8 +254,12 @@
 				writer.append(ch);
 			}
 		} else {
-			if (preserveSpaces || !context.isIndenting() || ch != ' '
-					|| writer.charAt(writer.length() - 1) != ' ') {
+			if (!preserveSpaces && context.isIndenting()
+					&& !context.isComment() && FormatterUtils.isSpace(ch)) {
+				if (writer.charAt(writer.length() - 1) != ' ') {
+					writer.append(' ');
+				}
+			} else {
 				writer.append(ch);
 			}
 		}
diff --git a/core/plugins/org.eclipse.dltk.formatter/src/org/eclipse/dltk/formatter/IFormatterContext.java b/core/plugins/org.eclipse.dltk.formatter/src/org/eclipse/dltk/formatter/IFormatterContext.java
index 6797379..3e1a9b5 100644
--- a/core/plugins/org.eclipse.dltk.formatter/src/org/eclipse/dltk/formatter/IFormatterContext.java
+++ b/core/plugins/org.eclipse.dltk.formatter/src/org/eclipse/dltk/formatter/IFormatterContext.java
@@ -25,7 +25,11 @@
 
 	boolean isIndenting();
 
-	void setIndenting(boolean valud);
+	void setIndenting(boolean value);
+
+	boolean isComment();
+
+	void setComment(boolean value);
 
 	int getBlankLines();