Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 420360

Summary: Copy to clipboard on Linux does't retain syntax highlighting (RTF)
Product: [Eclipse Project] Platform Reporter: Jörg von Frantzius <jfrantzius>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED NOT_ECLIPSE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, ericwill, piotr.findeisen
Version: 4.3Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Example with pasted colors none

Description Jörg von Frantzius CLA 2013-10-25 05:47:50 EDT
Copying of Java code to the clipboard on Linux does not retain syntax highlighting. It would be great to have it on Linux as well (it does work on Windows).

This is not bug#64498, i.e. there is no collapsed folding section.
Comment 1 Dani Megert CLA 2013-10-25 05:57:41 EDT
(In reply to Jörg von  Frantzius from comment #0)
> Copying of Java code to the clipboard on Linux does not retain syntax
> highlighting. It would be great to have it on Linux as well (it does work on
> Windows).

It also works on Linux if you use an editor that's capable of RTF. See attached example.
Comment 2 Dani Megert CLA 2013-10-25 05:59:20 EDT
Created attachment 236880 [details]
Example with pasted colors
Comment 3 Jörg von Frantzius CLA 2013-10-25 06:50:20 EDT
Interesting, when I paste to LibreOffice it does work for me as well, but not in the Thunderbird email editor. When I then copy the same code snippet from LibreOffice Writer and paste it into Thunderbird, the formatting is retained. Unfortunately, the intendation gets lost when doing so.

The exact same behaviour shows with the GMail editor in the browser (Chrome, in my case): no RTF when pasting directly from Eclipse, lost indentation when pasting via LibreOffice.

Would it be possible to have both formatting and indentation retained when pasting to Thunderbird and Gmail?
Comment 4 Dani Megert CLA 2013-10-25 06:57:04 EDT
(In reply to Jörg von  Frantzius from comment #3)
> Interesting, when I paste to LibreOffice it does work for me as well, but
> not in the Thunderbird email editor. When I then copy the same code snippet
> from LibreOffice Writer and paste it into Thunderbird, the formatting is
> retained. Unfortunately, the intendation gets lost when doing so.
> 
> The exact same behaviour shows with the GMail editor in the browser (Chrome,
> in my case): no RTF when pasting directly from Eclipse, lost indentation
> when pasting via LibreOffice.
> 
> Would it be possible to have both formatting and indentation retained when
> pasting to Thunderbird and Gmail?

Sorry, but this rather indicates that they don't accept plain RTF. Forwarding to SWT for final comment.
Comment 5 Eric Williams CLA 2018-12-14 14:05:02 EST
I think is more an issue with the client receiving the text, since LibreOffice receives it just fine -- sounds like Thunderbird and GMail don't accept RTF. From our end there isn't much we can do about that.