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

(-)a/editor.lib/src/org/netbeans/editor/BaseKit.java (-3 / +2 lines)
Lines 1186-1192 public class BaseKit extends DefaultEdit Link Here
1186
1186
1187
                BaseDocument doc = (BaseDocument)target.getDocument();
1187
                BaseDocument doc = (BaseDocument)target.getDocument();
1188
                Caret caret = target.getCaret();
1188
                Caret caret = target.getCaret();
1189
                int dotPos = caret.getDot();
1190
1189
1191
                Formatter formatter = doc.getFormatter();
1190
                Formatter formatter = doc.getFormatter();
1192
                formatter.indentLock();
1191
                formatter.indentLock();
Lines 1194-1202 public class BaseKit extends DefaultEdit Link Here
1194
                DocumentUtilities.setTypingModification(doc, true);
1193
                DocumentUtilities.setTypingModification(doc, true);
1195
                try{
1194
                try{
1196
                    target.replaceSelection("");
1195
                    target.replaceSelection("");
1197
                    int newDotPos = dotPos; 		  // dot stays where it was
1196
                    final int dotPos = caret.getDot();      // dot stays where it was
1198
                    formatter.indentNewLine(doc, dotPos);   // newline
1197
                    formatter.indentNewLine(doc, dotPos);   // newline
1199
                    caret.setDot(newDotPos);
1198
                    caret.setDot(dotPos);
1200
                } finally {
1199
                } finally {
1201
                    DocumentUtilities.setTypingModification(doc, false);
1200
                    DocumentUtilities.setTypingModification(doc, false);
1202
                    doc.atomicUnlock();
1201
                    doc.atomicUnlock();

Return to bug 120011