Skip to content

Commit 401d483

Browse files
brychcyiloveeclipse
authored andcommitted
Make "Replace with Clipboard" work in active editor of FormEditor
e.g. m2e's MavenPomEditor or PDE's ManifestEditor Signed-off-by: Till Brychcy <[email protected]>
1 parent 2989f6d commit 401d483

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ClipboardReplace.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.eclipse.ui.IFileEditorInput;
3232
import org.eclipse.ui.IWorkbenchPage;
3333
import org.eclipse.ui.PlatformUI;
34+
import org.eclipse.ui.forms.editor.FormEditor;
3435
import org.eclipse.ui.texteditor.ITextEditor;
3536

3637
public class ClipboardReplace extends BaseCompareAction {
@@ -42,6 +43,9 @@ protected void run(ISelection selection) {
4243
try {
4344
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
4445
IEditorPart editor = page.getActiveEditor();
46+
if (editor instanceof FormEditor fromEditor) {
47+
editor = fromEditor.getActiveEditor();
48+
}
4549
IEditorInput input = editor.getEditorInput();
4650
if (input instanceof IFileEditorInput ed) {
4751
IFile file2 = ed.getFile();

0 commit comments

Comments
 (0)