This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 120011
Collapse All | Expand All

(-)./editor/lib/src/org/netbeans/editor/BaseKit.java (-3 / +2 lines)
Lines 1196-1202 Link Here
1196
1196
1197
                BaseDocument doc = (BaseDocument)target.getDocument();
1197
                BaseDocument doc = (BaseDocument)target.getDocument();
1198
                Caret caret = target.getCaret();
1198
                Caret caret = target.getCaret();
1199
                int dotPos = caret.getDot();
1200
1199
1201
                Formatter formatter = doc.getFormatter();
1200
                Formatter formatter = doc.getFormatter();
1202
                formatter.indentLock();
1201
                formatter.indentLock();
Lines 1204-1212 Link Here
1204
                DocumentUtilities.setTypingModification(doc, true);
1203
                DocumentUtilities.setTypingModification(doc, true);
1205
                try{
1204
                try{
1206
                    target.replaceSelection("");
1205
                    target.replaceSelection("");
1207
                    int newDotPos = dotPos; 		  // dot stays where it was
1206
                    final int dotPos = caret.getDot();      // dot stays where it was
1208
                    formatter.indentNewLine(doc, dotPos);   // newline
1207
                    formatter.indentNewLine(doc, dotPos);   // newline
1209
                    caret.setDot(newDotPos);
1208
                    caret.setDot(dotPos);
1210
                } finally {
1209
                } finally {
1211
                    DocumentUtilities.setTypingModification(doc, false);
1210
                    DocumentUtilities.setTypingModification(doc, false);
1212
                    doc.atomicUnlock();
1211
                    doc.atomicUnlock();

Return to bug 120011