This commit is contained in:
Alexey Kudravtsev
2015-07-15 16:48:47 +03:00
parent 2b7e335b71
commit 0003911c23
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 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.
@@ -165,8 +165,6 @@ public final class TrailingSpacesStripper extends FileDocumentManagerAdapter {
// when virtual space enabled, we can strip whitespace anywhere
boolean isVirtualSpaceEnabled = activeEditor == null || activeEditor.getSettings().isVirtualSpace();
boolean markAsNeedsStrippingLater;
final List<Caret> carets = activeEditor == null ? Collections.<Caret>emptyList() : activeEditor.getCaretModel().getAllCarets();
final List<VisualPosition> visualCarets = new ArrayList<VisualPosition>(carets.size());
int[] caretOffsets = new int[carets.size()];
@@ -176,8 +174,9 @@ public final class TrailingSpacesStripper extends FileDocumentManagerAdapter {
caretOffsets[i] = caret.getOffset();
}
markAsNeedsStrippingLater = ((DocumentImpl)document).stripTrailingSpaces(activeEditor == null ? null : activeEditor.getProject(),
inChangedLinesOnly, isVirtualSpaceEnabled, caretOffsets);
boolean markAsNeedsStrippingLater =
((DocumentImpl)document).stripTrailingSpaces(activeEditor == null ? null : activeEditor.getProject(),
inChangedLinesOnly, isVirtualSpaceEnabled, caretOffsets);
if (activeEditor != null && !ShutDownTracker.isShutdownHookRunning()) {
activeEditor.getCaretModel().runBatchCaretOperation(new Runnable() {