use of com.intellij.codeInsight.editorActions.TextBlockTransferableData in project intellij-community by JetBrains.
the class EditorCopyPasteHelperImpl method copySelectionToClipboard.
@Override
public void copySelectionToClipboard(@NotNull Editor editor) {
ApplicationManager.getApplication().assertIsDispatchThread();
List<TextBlockTransferableData> extraData = new ArrayList<>();
String s = editor.getCaretModel().supportsMultipleCarets() ? getSelectedTextForClipboard(editor, extraData) : editor.getSelectionModel().getSelectedText();
if (s == null)
return;
s = TextBlockTransferable.convertLineSeparators(s, "\n", extraData);
Transferable contents = editor.getCaretModel().supportsMultipleCarets() ? new TextBlockTransferable(s, extraData, null) : new StringSelection(s);
CopyPasteManager.getInstance().setContents(contents);
}
Aggregations