If caret is not inside paragraph (e.g. buffer is empty), then in action "Format paragraph" occurs StringIndexOutOfBoundsException. ------------------------------------- java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(Unknown Source) at org.gjt.sp.jedit.TextUtilities.ignoringWhitespaceIndex(TextUtilities.java:667) at org.gjt.sp.jedit.textarea.JEditTextArea.formatParagraph(JEditTextArea.java:4107) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.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:229) at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:195) at org.gjt.sp.jedit.gui.DefaultInputHandler.handleKey(DefaultInputHandler.java:362) at org.gjt.sp.jedit.View.processKeyEvent(View.java:617) at org.gjt.sp.jedit.textarea.JEditTextArea.processKeyEvent(JEditTextArea.java:4582) 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) ------------------------------------- Maybe similar problem: https://sourceforge.net/tracker/ index.php?func=detail&aid=1173630&group_id=588&atid=100588