[diff]: move scrollToChange method implementation to its base class

This commit is contained in:
Nadya Zabrodina
2017-05-17 17:22:52 +03:00
parent 7984542877
commit 570528accd
2 changed files with 4 additions and 6 deletions
@@ -957,11 +957,6 @@ public class UnifiedDiffViewer extends ListenerDiffViewerBase {
protected int getEndLine(@NotNull UnifiedDiffChange change) {
return change.getLine2();
}
@Override
protected void scrollToChange(@NotNull UnifiedDiffChange change) {
DiffUtil.scrollEditor(myEditor, change.getLine1(), true);
}
}
private class MyOpenInEditorWithMouseAction extends OpenInEditorWithMouseAction {
@@ -15,6 +15,7 @@
*/
package com.intellij.diff.tools.util;
import com.intellij.diff.util.DiffUtil;
import com.intellij.openapi.editor.ex.EditorEx;
import org.jetbrains.annotations.NotNull;
@@ -31,7 +32,9 @@ public abstract class PrevNextDifferenceIterableBase<T> implements PrevNextDiffe
protected abstract int getEndLine(@NotNull T change);
protected abstract void scrollToChange(@NotNull T change);
protected void scrollToChange(@NotNull T change) {
DiffUtil.scrollEditor(getEditor(), getStartLine(change), true);
}
@Override
public boolean canGoNext() {