mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-120858 dir-diff: do not apply changes on Enter if focus is in Editor
This commit is contained in:
+3
-1
@@ -16,6 +16,7 @@
|
||||
package com.intellij.openapi.diff.impl.dir.actions;
|
||||
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.actionSystem.ex.ActionUtil;
|
||||
import com.intellij.openapi.diff.impl.dir.DirDiffTableModel;
|
||||
import com.intellij.util.containers.JBIterable;
|
||||
@@ -40,7 +41,8 @@ public class SynchronizeDiff extends DirDiffAction {
|
||||
if (!e.getPresentation().isEnabled()) {
|
||||
return;
|
||||
}
|
||||
boolean enabled = !JBIterable.from(mySelectedOnly ? getModel().getSelectedElements() : getModel().getElements())
|
||||
boolean enabled = e.getData(CommonDataKeys.EDITOR) == null;
|
||||
enabled &= !JBIterable.from(mySelectedOnly ? getModel().getSelectedElements() : getModel().getElements())
|
||||
.filter(d -> d.getOperation() == COPY_FROM || d.getOperation() == COPY_TO || d.getOperation() == DELETE)
|
||||
.filter(d -> d.getSource() == null || d.getSource().isOperationsEnabled())
|
||||
.filter(d -> d.getTarget() == null || d.getTarget().isOperationsEnabled())
|
||||
|
||||
Reference in New Issue
Block a user