Bug 45969 - [misc] add option to disable styled-text when copy/paste clipboard
Summary: [misc] add option to disable styled-text when copy/paste clipboard
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P5 enhancement with 8 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-03 11:59 EST by quartz quartz CLA
Modified: 2022-06-01 01:57 EDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description quartz quartz CLA 2003-11-03 11:59:41 EST
when pasting copied text in other editors (doc, email, etc...)
we end up with colors and fonts all the time without request, annoyingly
destroying the prepared formatting.

Please add option to disable text style when using copy/paste (disable the
styled Transferable, offer only plain text string)

(Which makes me think that there is useless extra processing performed when
copy/pasting locally, inside eclipse, just to push the text styles.)
Comment 1 Dani Megert CLA 2003-11-04 04:31:00 EST
It copies normal and rich text to the clipboard. It is up to the receiving
application to offer/decide how to paste (e.g. some editors paste the normal
text, others paste the rich text and other offer Paste Special... commands.
Comment 2 quartz quartz CLA 2003-11-04 10:37:06 EST
Misunderstood the RFE.

1-copy/pasting locally is slower than in any other editor I know. I actually
have to wait sometimes, I suppose because it uses so many transient objects for
making the rich text thing, and GC them. Disabling rich text transferable could
speed this up.

2-it would be a convenience to work around for all
editor-which-do-not-offer-many-ways-for-pasting... That is pretty much all of
them. Mail clients, html editor, etc...

3-I don't see why a simple boolean, "if" statement and checkbox in the editor
preference would be such a big deal that the RFE must be closed (and obviously
not discussed) within 5 hours.
Comment 3 Dani Megert CLA 2003-11-04 11:14:49 EST
re 1) can you give a concrete test case (I copied a file with > 4500 lines from
the Java editor to the clipboard and it was fast)

re 2) the two mail clients and the text editors which I have at hand (including
notepad) either automatically paste normal text or offer special pasting. Which
are the products that paste rich text and do not offer to paste as normal text?
Comment 4 quartz quartz CLA 2003-11-04 16:18:10 EST
1-never mind... any UI control hangs as frequently because of GC (too much
transient objects bug #39201), not just copy/paste.

2-outlook for a first. But the RFE is about tweaking prodution of the clipboard
content, not consuming it. I also want to avoid using the extra menu search aim
& clicks to paste "special" just to ctrl-v paste a text.

You may want to simply try change the order of the DataFlavor[] in
Transferable.getTransferDataFlavors(). Put the plain text first.

Anyway, paste special should be actually for richtext. The default should be
plain text.
Comment 5 Dani Megert CLA 2003-11-05 04:47:28 EST
There are no plans to change the current behavior.
Comment 6 quartz quartz CLA 2003-11-05 09:32:15 EST
Of course there are no plans. Otherwise I wouldn't be submitting it.
That's why there are RFEs in bugzilla, so that the feature request can be filed,
and implemented at the next opportunity.

Granted it is not a revolutionnary feature, but it is not a dumb feature as it
simplifies the user work, which is the goal of an IDE, and the mission of this team.

FYI: this is not java-editor specific, hence bust be reported to platform text.
Comment 7 Jason San Jose CLA 2010-02-16 20:10:39 EST
This was also reported against Adobe Flash Builder 4 http://bugs.adobe.com/jira/browse/FB-23783. Here are my notes:

External bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=45969.

In FB and the JDT, it seems to depend on the context. For example, in FB, copying this whole function, with or without trailing whitespace, works fine (i.e. no selection highlight is pasted, only syntax coloring):

public function testColors():Boolean {
return true;
}

If you just select the return statement line (from return to the semi-colon), Outlook 2007 picks up the selection highlight.

The same is true in the JDT with this example:

public static int getCurrentEventKeyModifiers()
{
return 0; // Not yet implemented on Windows
}
Comment 8 Dani Megert CLA 2011-08-10 03:21:09 EDT

*** This bug has been marked as a duplicate of bug 86503 ***
Comment 9 Dani Megert CLA 2011-08-10 03:22:55 EDT
Not a dup.
Comment 10 Matt Fozard CLA 2013-02-06 06:10:31 EST
Would it really be so hard to have a "Copy as plain text" command next to the existing "Copy"? Or a keyboard command to do this?

I'm trying to paste text from Eclipse into pgAdmin today, but it can't handle rich text and just pastes in garbage characters. There is no "paste as plain text" in pgAdmin. So to do this I need to copy from Eclipse, paste into Notepad, select all, copy again, and then paste into pgAdmin.

In other words, using Eclipse for development today is making my life harder.
Comment 11 Dani Megert CLA 2013-02-06 07:21:24 EST
(In reply to comment #10)
> Would it really be so hard to have a "Copy as plain text" command next to
> the existing "Copy"? Or a keyboard command to do this?
> 
> I'm trying to paste text from Eclipse into pgAdmin today, but it can't
> handle rich text and just pastes in garbage characters. There is no "paste
> as plain text" in pgAdmin. So to do this I need to copy from Eclipse, paste
> into Notepad, select all, copy again, and then paste into pgAdmin.
> 
> In other words, using Eclipse for development today is making my life harder.

Eclipse already puts the plain text into the clipboard. If your application does not support to paste plain text, then that's where you need to file the bug.
Comment 12 Todd Chambery CLA 2013-09-25 14:41:41 EDT
+1

I use a "light on dark" theme, and pasting code into any MS office application is unreadable because the background is not preserved.

This particularly a problem in Microsoft Office Communicator. 

I have to copy, paste into Sublime, copy again, paste into MOC.  

I don't have any use for rich text copy, please offer an option/runtime flag to disable this feature.
Comment 13 Bill Culp CLA 2014-03-04 14:59:02 EST
It unclear what use case pasting rich text even has.  Rather than an option to turn it off, RTF pasting should be removed.
Comment 14 quartz quartz CLA 2014-03-05 19:39:16 EST
As I wrote, a mere checkbox option to disable the rich text transferable in the clipboard would suffice.

But even better is the suggestion to have an action just for it, so one can bind an alternate hot key if wanted. Default of ctrl-c would be to copy RTF, but we could unbind that for using plain text copy, and bind some other combo to RTF copy.
Comment 15 Gabriel Ouimet CLA 2018-04-18 08:26:38 EDT
I definitely would need this resolved as it is very annoying that, by default, you can't paste into another app without having the formatting all screwed up making the text unviewable.  I would rather that the default be unformatted text.

Maybe it`s too complicated or maybe it`s low priority but to have this for 15 years is ridiculous.  This is high priority for me as I avoided using Eclipse for this very reason for years.  Now I`m stuck using it and it really sucks.