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

Bug 322847

Summary: Autoedit strategy for newlines in CSS should indent correctly
Product: [WebTools] WTP Source Editing Reporter: Nick Sandonato <nsand.dev>
Component: wst.cssAssignee: Nick Sandonato <nsand.dev>
Status: RESOLVED FIXED QA Contact: Nick Sandonato <nsand.dev>
Severity: enhancement    
Priority: P3 CC: jaroslav.zaruba
Version: 3.2   
Target Milestone: 3.3 M1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch none

Description Nick Sandonato CLA 2010-08-16 17:17:49 EDT
When adding a newline for a CSS selector, proper indentation should be added. For example:

a {|}

pressing Enter at the | should cause the format

a {
[tab]|
}
Comment 1 Nick Sandonato CLA 2010-08-16 17:23:44 EDT
Created attachment 176740 [details]
patch
Comment 2 Nick Sandonato CLA 2010-08-16 17:25:28 EDT
Released.
Comment 3 jzaruba CLA 2010-08-28 17:22:33 EDT
I'm not sure I do understand what 'Autoedit strategy' means here, but auto-indent in CSS editor still works in a weird way.

div|

^^ now hitting Enter should not produce this:
div
\t|
but rather this:
div
|


... and if I go along with this weird indent and create a block:

div
\t{|
\t}

^^ hitting Enter should definitely add indentation, instead what I get is this:
div
\t{
\t|
\t}

I believe the CSS-editor goes against the auto-indent habits/conventions, where the rule is quite simple: 'add indent after opening curly brace, remove indent before one, maintan indent otherwise'.