From b7157554b085a51f4f608267efaa09669603f52f Mon Sep 17 00:00:00 2001 From: irengrig Date: Fri, 25 Dec 2009 17:45:31 +0300 Subject: [PATCH] VCS: apply patch - correct file to show in diff --- .../openapi/vcs/changes/patch/ApplyPatchDifferentiatedDialog.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDifferentiatedDialog.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDifferentiatedDialog.java index 227227fe6d..ec3d0cef02 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDifferentiatedDialog.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDifferentiatedDialog.java @@ -824,7 +824,6 @@ public class ApplyPatchDifferentiatedDialog extends DialogWrapper { final List selectedChanges = myChangesTreeList.getSelectedChanges(); int selectedIdx = 0; - int idx = 0; final ArrayList diffRequestPresentables = new ArrayList(changes.size()); if (! selectedChanges.isEmpty()) { final FilePatchInProgress.PatchChange c = selectedChanges.get(0); @@ -836,13 +835,11 @@ public class ApplyPatchDifferentiatedDialog extends DialogWrapper { diffRequestPresentables.add(diffRequestPresentable); } if (change.equals(c)) { - selectedIdx = idx; + selectedIdx = diffRequestPresentables.size() - 1; } - ++ idx; } } if (diffRequestPresentables.isEmpty()) return; - selectedIdx = (selectedIdx >= diffRequestPresentables.size()) ? 0 : selectedIdx; ShowDiffAction.showDiffImpl(myProject, diffRequestPresentables, selectedIdx, ShowDiffAction.DiffExtendUIFactory.NONE, false); } } -- 2.11.4.GIT