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

Bug 332688

Summary: [typing] pasting multi-line string constant increases indent
Product: [Eclipse Project] JDT Reporter: Stephan Herrmann <stephan.herrmann>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 3.7   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
Whiteboard:

Description Stephan Herrmann CLA 2010-12-15 15:56:07 EST
Every time I paste a multi-line string containing test-code into one
of JDT/Core's tests the indentation appears completely random at first.

At a closer look it seems that paste recognizes lbrace within string
constants and will increase the indent for the next line (wrong).
Rbrace, however, is not recognized (good).

Also, while I'm at it: copy&paste of comment lines like these

// https://bugs.eclipse.org/bugs/show_bug.cgi?id=325755 
// null analysis -- conditional expression, many locals

will eat the space between "//" and text to result in:

//https://bugs.eclipse.org/bugs/show_bug.cgi?id=325755 
//null analysis -- conditional expression, many locals

I can't recall changing any editor options. Project specific preferences
are used as stored in CVS of org.eclipse.jdt.core.tests.compiler.
Comment 1 Dani Megert CLA 2010-12-16 03:02:44 EST
Stephan, I think this is fixed but hard to tell since you don't give the build id. Also, please file one problem per bug report.

If you still see any of the issues in 3.7 M4 or newer then please raise individual bugs. Best with a little test case/snippet.
Comment 2 Stephan Herrmann CLA 2010-12-16 08:43:09 EST
(In reply to comment #1)
> Stephan, I think this is fixed but hard to tell since you don't give the build
> id. Also, please file one problem per bug report.
> 
> If you still see any of the issues in 3.7 M4 or newer then please raise
> individual bugs. Best with a little test case/snippet.

Dani, sorry that report was a bit sloppy, I agree.
(I was eager to help Ayush get bug 332637 fixed but didn't want to forget
 this issue which had annoyed my for some weeks.)

The bug occurred in M3 and just now I updated to M4 and indeed it works fine.