New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shift+Tab Exception #19

Closed
RobertBColton opened this Issue Nov 4, 2014 · 0 comments

Comments

Projects
None yet
1 participant
@RobertBColton
Contributor

RobertBColton commented Nov 4, 2014

This is not a regression and exists in lgm1.8.2

  • In eclipse, tab with a selection will delete your selection and insert a space
  • In eclipse, shift tab with a selection will maintain your selection and unindent the current line
  • Notepad++ will change the selection to just the left most caret position, the start in other words, and continue unindenting the cursor until it is just before the first character on the line and then begins to unindent the line. Tab will behave as it does in Eclipse and delete your selection and replace it with a space.
  • GM8.1 and Studio the selected line is indented and unindented while maintaining the selection

The issue is rooted in the following line, the selection is being increased regardless of whether the line was actually indented/unindented.
https://github.com/JoshDreamland/JoshEdit/blob/master/org/lateralgm/joshedit/JoshText.java#L2145

  1. Select part of a line of code
    Tab Selection
  2. Hold shift+tab and the selection will be maintained and the line will be unindented
  3. Once it can no longer unindent the line will stay the same but the selection will continue moving to the right until it goes out of bounds
  4. Press enter for a new line
    Tab Select OOB
Stack trace:
java.lang.StringIndexOutOfBoundsException
    at java.lang.AbstractStringBuilder.delete(Unknown Source)
    at java.lang.StringBuilder.delete(Unknown Source)
    at org.lateralgm.joshedit.Selection.deleteSel(Selection.java:330)
    at org.lateralgm.joshedit.JoshText.processKeyTyped(JoshText.java:2048)
    at org.lateralgm.joshedit.JoshText.processComponentKeyEvent(JoshText.java:2509)
    at javax.swing.JComponent.processKeyEvent(Unknown Source)
    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.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$400(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment