mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix [VCS]: Improve changelist multi selection for Navigation in the diff view IJPL-247915
(cherry picked from commit ec54ba04205f301857629d2035408734faa99078) GitOrigin-RevId: 25efc16a16908ba333198c41fd32fe7681538fb1
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2d58cf364f
commit
d91574b5fe
+7
-2
@@ -260,7 +260,7 @@ public abstract class ChangeViewDiffRequestProcessor extends CacheDiffRequestPro
|
||||
protected @Nullable AnAction createGoToChangeAction() {
|
||||
Supplier<ListSelection<? extends Wrapper>> changesSupplier =
|
||||
Registry.is("vcs.diff.preview.scope.navigation.to.group")
|
||||
? this::getCurrentGroupListSelection
|
||||
? this::getGroupOrMultiSelectionListSelection
|
||||
: this::getChanges;
|
||||
return PresentableGoToChangePopupAction.create(changesSupplier::get, new MyGoToChangePopupController());
|
||||
}
|
||||
@@ -273,11 +273,16 @@ public abstract class ChangeViewDiffRequestProcessor extends CacheDiffRequestPro
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
private @NotNull ListSelection<? extends Wrapper> getCurrentGroupListSelection() {
|
||||
private @NotNull ListSelection<? extends Wrapper> getGroupOrMultiSelectionListSelection() {
|
||||
Wrapper currentChange = getCurrentChange();
|
||||
if (currentChange == null) {
|
||||
return ListSelection.empty();
|
||||
}
|
||||
// If there is an explicit multiple selection (2+ items), scope the navigation to it.
|
||||
List<? extends Wrapper> selectedChanges = ContainerUtil.newArrayList(iterateSelectedChanges());
|
||||
if (selectedChanges.size() > 1) {
|
||||
return ListSelection.create(selectedChanges, currentChange);
|
||||
}
|
||||
List<? extends Wrapper> groupChanges = toListIfNotMany(iterateChangesInSameGroup(currentChange), true);
|
||||
if (groupChanges == null) {
|
||||
return ListSelection.empty();
|
||||
|
||||
Reference in New Issue
Block a user