summaryrefslogtreecommitdiff
path: root/platform/lang-impl/src/com/intellij/codeInsight/actions/FormatChangedTextUtil.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/lang-impl/src/com/intellij/codeInsight/actions/FormatChangedTextUtil.java')
-rw-r--r--platform/lang-impl/src/com/intellij/codeInsight/actions/FormatChangedTextUtil.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/FormatChangedTextUtil.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/FormatChangedTextUtil.java
index bf77a3022a0e..af6bbdc931ca 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/actions/FormatChangedTextUtil.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/FormatChangedTextUtil.java
@@ -289,7 +289,16 @@ public class FormatChangedTextUtil {
}
try {
- List<Range> changedRanges = new RangesBuilder(document, documentFromVcs).getRanges();
+ List<Range> changedRanges;
+
+ LineStatusTracker tracker = LineStatusTrackerManager.getInstance(project).getLineStatusTracker(document);
+ if (tracker != null) {
+ changedRanges = tracker.getRanges();
+ }
+ else {
+ changedRanges = new RangesBuilder(document, documentFromVcs).getRanges();
+ }
+
return getChangedTextRanges(document, changedRanges);
}
catch (FilesTooBigForDiffException e) {