mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-187479 diff: do not show active diff tool in "Diff Settings Popup"
Active tool might be a substituted one, so we should not show its "base" tool.
This commit is contained in:
@@ -198,8 +198,8 @@ public abstract class DiffRequestProcessor implements Disposable {
|
||||
FrameDiffTool tool = tools.isEmpty() ? ErrorDiffTool.INSTANCE : tools.get(0);
|
||||
|
||||
if (applySubstitutor) {
|
||||
DiffTool substitutor = DiffUtil.findToolSubstitutor(tool, myContext, myActiveRequest);
|
||||
if (substitutor instanceof FrameDiffTool) return (FrameDiffTool)substitutor;
|
||||
FrameDiffTool substitutor = findToolSubstitutor(tool);
|
||||
if (substitutor != null) return substitutor;
|
||||
}
|
||||
|
||||
return tool;
|
||||
@@ -220,8 +220,8 @@ public abstract class DiffRequestProcessor implements Disposable {
|
||||
result.add((FrameDiffTool)tool);
|
||||
}
|
||||
else {
|
||||
DiffTool substitutor = DiffUtil.findToolSubstitutor(tool, myContext, myActiveRequest);
|
||||
if (substitutor instanceof FrameDiffTool) {
|
||||
FrameDiffTool substitutor = findToolSubstitutor(tool);
|
||||
if (substitutor != null) {
|
||||
result.add((FrameDiffTool)tool);
|
||||
}
|
||||
}
|
||||
@@ -235,6 +235,11 @@ public abstract class DiffRequestProcessor implements Disposable {
|
||||
return DiffUtil.filterSuppressedTools(result);
|
||||
}
|
||||
|
||||
private FrameDiffTool findToolSubstitutor(@NotNull DiffTool tool) {
|
||||
DiffTool substitutor = DiffUtil.findToolSubstitutor(tool, myContext, myActiveRequest);
|
||||
return substitutor instanceof FrameDiffTool ? (FrameDiffTool)substitutor : null;
|
||||
}
|
||||
|
||||
private void moveToolOnTop(@NotNull DiffTool tool) {
|
||||
myToolOrder.remove(tool);
|
||||
|
||||
@@ -448,7 +453,8 @@ public abstract class DiffRequestProcessor implements Disposable {
|
||||
|
||||
List<AnAction> selectToolActions = new ArrayList<>();
|
||||
for (DiffTool tool : getAvailableFittedTools()) {
|
||||
if (tool == myState.getActiveTool()) continue;
|
||||
FrameDiffTool substitutor = findToolSubstitutor(tool);
|
||||
if (tool == myState.getActiveTool() || substitutor == myState.getActiveTool()) continue;
|
||||
selectToolActions.add(new DiffToolToggleAction(tool));
|
||||
}
|
||||
DiffUtil.addActionBlock(myPopupActionGroup, selectToolActions);
|
||||
|
||||
Reference in New Issue
Block a user