The indenting refactoring introduced some NullPointerExceptions. I've "catched" one in r8096, but as stated in the commit message, it's probably an error further up. r8096 should be reverted. The problem seems to be that ctx.rules.getModeName() returns null, while it should return the main rule name. To reproduce: Save an empty buffer as test.php. Type: --------------- --------------- When pressing ENTER, after the "'", the following exception gets thrown: java.lang.NullPointerException at org.gjt.sp.jedit.buffer.JEditBuffer.getIdealIndentForLine(JEditBuffer.java:991) at org.gjt.sp.jedit.buffer.JEditBuffer.indentLine(JEditBuffer.java:907) at org.gjt.sp.jedit.textarea.TextArea.insertEnterAndIndent(TextArea.java:4327) at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at bsh.Reflect.invokeMethod(Reflect.java:134) at bsh.Reflect.invokeObjectMethod(Reflect.java:80) at bsh.Name.invokeMethod(Name.java:858) at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:75) at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102) at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47) at bsh.BSHBlock.evalBlock(BSHBlock.java:130) at bsh.BSHBlock.eval(BSHBlock.java:80) at bsh.BshMethod.invokeImpl(BshMethod.java:362) at bsh.BshMethod.invoke(BshMethod.java:258) at bsh.BshMethod.invoke(BshMethod.java:186) at org.gjt.sp.jedit.BeanShell.runCachedBlock(BeanShell.java:509) at org.gjt.sp.jedit.BeanShellAction.invoke(BeanShellAction.java:76) at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:415) at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:381) at org.gjt.sp.jedit.gui.DefaultInputHandler.handleKey(DefaultInputHandler.java:373) at org.gjt.sp.jedit.input.AbstractInputHandler.processKeyEventKeyStrokeHandling(AbstractInputHandler.java:116) at org.gjt.sp.jedit.gui.InputHandler.processKeyEvent(InputHandler.java:184) at org.gjt.sp.jedit.textarea.TextArea.processKeyEvent(TextArea.java:4572) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)