Bug 268070 - [typing] When pasting text into string, only escape if necessary
Summary: [typing] When pasting text into string, only escape if necessary
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P5 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-11 05:29 EDT by Benjamin Pasero CLA
Modified: 2020-01-10 15:14 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Pasero CLA 2009-03-11 05:29:54 EDT
Build ID: I20090227-1422

I am always having "Escape text when pasting into string literal" enabled. However, sometimes I paste some text that is already escaped (e.g. from another String) and it gets escaped for a second time. Please consider an option where text is not escaped if its already in escaped form.

E.g. Hello \n World becomes Hello \\n World which is wrong.

More information:
Comment 1 Markus Keller CLA 2009-03-11 07:29:57 EDT
I think guessing whether a string is already escaped would be even more confusing. If you don't want the string to be escaped, simply paste it outside of a string literal (surround with " later, or temporarily add a " to close the current string).
Comment 2 Dani Megert CLA 2009-03-11 07:39:10 EDT
Agree with Markus. Plus: you can toggle the smart insert mode (Ctrl+Shift+Insert) before pasting.
Comment 3 Benjamin Pasero CLA 2009-03-11 07:46:36 EDT
(In reply to comment #1)
> I think guessing whether a string is already escaped would be even more
> confusing. If you don't want the string to be escaped, simply paste it outside
> of a string literal (surround with " later, or temporarily add a " to close the
> current string).
> 

That is my current (annoying) work around.
Comment 4 Aaron Digulla CLA 2010-12-30 05:46:03 EST
Duplicate of bug 72869. I like the proposal "unescape string when you copy from it."

How about a quick fix to escape/unescape one level?
Comment 5 Deepak Azad CLA 2010-12-30 14:48:21 EST
(In reply to comment #4)
> Duplicate of bug 72869. 
Nope. This bug is about pasting in a a string literal. bug 72869 is about copying from a string literal.
Comment 6 Deepak Azad CLA 2010-12-30 14:48:40 EST
See also bug 332205.
Comment 7 Eclipse Genie CLA 2020-01-10 15:14:11 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.