Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/saveactions/CodeFormatEditFactory.java

Issue 975483003: Issue 22598. Remove all the trailing whitespaces. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/saveactions/CodeFormatEditFactory.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/saveactions/CodeFormatEditFactory.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/saveactions/CodeFormatEditFactory.java
index facfc4682f6f3c75dc2633283bb4dc8e2811bafc..26776c69a5a15cbd222d591e3993bd291f4e3822 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/saveactions/CodeFormatEditFactory.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/saveactions/CodeFormatEditFactory.java
@@ -49,8 +49,7 @@ public class CodeFormatEditFactory {
* @return an edit that removes all trailing whitespace
* @throws CoreException if an error occurs in creating the edit
*/
- public static MultiTextEdit removeTrailingWhitespace(IDocument document, int selectionStart,
- int selectionEnd) throws CoreException {
+ public static MultiTextEdit removeTrailingWhitespace(IDocument document) throws CoreException {
MultiTextEdit textEdit = new MultiTextEdit();
@@ -80,13 +79,8 @@ public class CodeFormatEditFactory {
lineStart,
lineExclusiveEnd - 1,
document);
- j++;
-
- if (selectionStart != -1 && j == lineStart && selectionStart > lineStart
- && selectionEnd <= lineExclusiveEnd) {
- j = selectionStart;
- }
+ j++;
if (j < lineExclusiveEnd) {
DeleteEdit edit = new DeleteEdit(j, lineExclusiveEnd - j);
textEdit.addChild(edit);

Powered by Google App Engine
This is Rietveld 408576698