mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
remove exact matches without template text by index check
In RemDev, on frontend, we do `(merge (customize (merge (front back))) customized-on-backend (back))` children. Due to the merge, `ActionUrl.absolutePosition` can be incorrect. But we can customize backend actions on frontend. That would not be possible if we did `(merge (customize (front)) customized-on-backend (back))`. Fixes GTW-7803 Broken customized menu in Split Mode: Services in Tools case GitOrigin-RevId: 9ef937a98324f60287392077fd107c88fa04b86c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
dc6c748ff6
commit
9c6bf61d7f
+11
-10
@@ -113,27 +113,28 @@ public final class CustomizationUtil {
|
||||
}
|
||||
AnAction ca = actionUrl.getComponentAction();
|
||||
if (ca == null) continue;
|
||||
int position = actionUrl.getAbsolutePosition();
|
||||
if (actionUrl.getActionType() == ActionUrl.ADDED) {
|
||||
if (ca == group) {
|
||||
LOG.error("Attempt to add group to itself; group ID=" + actionManager.getId(group));
|
||||
continue;
|
||||
}
|
||||
if (reorderedChildren.size() > actionUrl.getAbsolutePosition()) {
|
||||
reorderedChildren.add(actionUrl.getAbsolutePosition(), ca);
|
||||
if (reorderedChildren.size() > position) {
|
||||
reorderedChildren.add(position, ca);
|
||||
}
|
||||
else {
|
||||
reorderedChildren.add(ca);
|
||||
}
|
||||
}
|
||||
else if (actionUrl.getActionType() == ActionUrl.DELETED && reorderedChildren.size() > actionUrl.getAbsolutePosition()) {
|
||||
AnAction ra = reorderedChildren.get(actionUrl.getAbsolutePosition());
|
||||
Presentation rt = ra.getTemplatePresentation();
|
||||
Presentation ct = ca.getTemplatePresentation();
|
||||
if (rt.getText() == null ? !(ct.getText() == null || ct.getText().isEmpty())
|
||||
: !rt.getText().equals(ct.getText())) {
|
||||
continue;
|
||||
else if (actionUrl.getActionType() == ActionUrl.DELETED) {
|
||||
if (!reorderedChildren.remove(ca)) {
|
||||
AnAction ra = reorderedChildren.get(position);
|
||||
Presentation rt = ra.getTemplatePresentation();
|
||||
Presentation ct = ca.getTemplatePresentation();
|
||||
if (rt.getText() == null ? StringUtil.isEmpty(ct.getText()) : rt.getText().equals(ct.getText())) {
|
||||
reorderedChildren.remove(position);
|
||||
}
|
||||
}
|
||||
reorderedChildren.remove(actionUrl.getAbsolutePosition());
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < reorderedChildren.size(); i++) {
|
||||
|
||||
Reference in New Issue
Block a user