Skip to content

Commit 0b40a9d

Browse files
authored
Merge pull request #8462 from matthiasblaesing/exclipboard2
Restore clipboard history for editor by using ExClipboard instead of directly accessing system clipboard
2 parents 6cb776c + f17455c commit 0b40a9d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

platform/openide.text/src/org/openide/text/QuietEditorPane.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
import javax.swing.text.JTextComponent;
6060
import org.openide.util.Lookup;
6161
import org.openide.util.NbBundle;
62+
import org.openide.util.datatransfer.ExClipboard;
6263
import org.openide.windows.ExternalDropHandler;
6364
import org.openide.windows.TopComponent;
6465

@@ -351,7 +352,8 @@ public void exportAsDrag(JComponent comp, InputEvent e, int action) {
351352

352353
@Override
353354
public void exportToClipboard(JComponent comp, Clipboard clip, int action) {
354-
delegator.exportToClipboard(comp, clip, action);
355+
ExClipboard clipboard = Lookup.getDefault().lookup(ExClipboard.class);
356+
delegator.exportToClipboard(comp, clipboard != null ? clipboard : clip, action);
355357
}
356358

357359
@Override

0 commit comments

Comments
 (0)