[392071] CSS editor unindents next line after copy-paste
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java
index 0db4744..8e0d1b4 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java
@@ -102,9 +102,6 @@
* Copies the indentation of the previous line.
*/
protected void autoIndentAfterNewLine(DocumentCommand command) {
- // select nearest white spaces to replace with new-line
- setRangeForNewLine(command);
-
// get position
int position = command.offset;
@@ -116,6 +113,10 @@
if (prev == null || !CSSRegionContexts.CSS_LBRACE.equals(prev.getType()))
return;
+ // select nearest white spaces to replace with new-line
+ setRangeForNewLine(command);
+ position = command.offset;
+
IStructuredDocumentRegion next = prev.getNext();
// create text to replace