This commit is contained in:
Sergey Ignatov
2015-07-03 10:08:18 +03:00
parent b9b51e0f3c
commit 30b0a964c9
2 changed files with 3 additions and 19 deletions
@@ -346,8 +346,8 @@ public class UnifiedDiffViewer extends ListenerDiffViewerBase {
EditorHighlighter highlighter2 = DiffUtil.initEditorHighlighter(project, content2, text2);
if (highlighter1 == null && highlighter2 == null) return null;
if (highlighter1 == null) highlighter1 = DiffUtil.initEmptyEditorHighlighter(project, text1);
if (highlighter2 == null) highlighter2 = DiffUtil.initEmptyEditorHighlighter(project, text2);
if (highlighter1 == null) highlighter1 = DiffUtil.initEmptyEditorHighlighter(text1);
if (highlighter2 == null) highlighter2 = DiffUtil.initEmptyEditorHighlighter(text2);
return new UnifiedEditorHighlighter(myDocument, highlighter1, highlighter2, ranges, textLength);
}
@@ -107,7 +107,7 @@ public class DiffUtil {
}
@NotNull
public static EditorHighlighter initEmptyEditorHighlighter(@Nullable Project project, @NotNull CharSequence text) {
public static EditorHighlighter initEmptyEditorHighlighter(@NotNull CharSequence text) {
EditorHighlighter highlighter = createEmptyEditorHighlighter();
highlighter.setText(text);
return highlighter;
@@ -216,10 +216,6 @@ public class DiffUtil {
scrollToCaret(editor, animated);
}
public static void scrollToPoint(@Nullable Editor editor, @NotNull Point point) {
scrollToPoint(editor, point, false);
}
public static void scrollToPoint(@Nullable Editor editor, @NotNull Point point, boolean animated) {
if (editor == null) return;
if (!animated) editor.getScrollingModel().disableAnimation();
@@ -876,14 +872,6 @@ public class DiffUtil {
return holder;
}
public static <T> UserDataHolderBase createUserDataHolder(@NotNull Key<T> key1, @Nullable T value1,
@NotNull Key<T> key2, @Nullable T value2) {
UserDataHolderBase holder = new UserDataHolderBase();
holder.putUserData(key1, value1);
holder.putUserData(key2, value2);
return holder;
}
public static boolean isUserDataFlagSet(@NotNull Key<Boolean> key, UserDataHolder... holders) {
for (UserDataHolder holder : holders) {
if (holder == null) continue;
@@ -1039,9 +1027,5 @@ public class DiffUtil {
this(ignorePolicy.getComparisonPolicy(), highlightPolicy.isFineFragments(), highlightPolicy.isShouldSquash(),
ignorePolicy.isShouldTrimChunks());
}
public DiffConfig() {
this(IgnorePolicy.DEFAULT, HighlightPolicy.BY_LINE);
}
}
}