Index: ./editor/lib/src/org/netbeans/editor/BaseKit.java =================================================================== RCS file: /cvs/editor/lib/src/org/netbeans/editor/BaseKit.java,v retrieving revision 1.1 diff -u -r1.1 BaseKit.java --- ./editor/lib/src/org/netbeans/editor/BaseKit.java 17 Nov 2007 00:39:35 -0000 1.1 +++ ./editor/lib/src/org/netbeans/editor/BaseKit.java 27 Nov 2007 08:38:44 -0000 @@ -1196,7 +1196,6 @@ BaseDocument doc = (BaseDocument)target.getDocument(); Caret caret = target.getCaret(); - int dotPos = caret.getDot(); Formatter formatter = doc.getFormatter(); formatter.indentLock(); @@ -1204,9 +1203,9 @@ DocumentUtilities.setTypingModification(doc, true); try{ target.replaceSelection(""); - int newDotPos = dotPos; // dot stays where it was + final int dotPos = caret.getDot(); // dot stays where it was formatter.indentNewLine(doc, dotPos); // newline - caret.setDot(newDotPos); + caret.setDot(dotPos); } finally { DocumentUtilities.setTypingModification(doc, false); doc.atomicUnlock();