kstenschke / shifter-plugin

Intelligent string/code manipulation plugin for Jetbrains IDEs: Detects shiftable type of word/line/selection and manipulates it on keyboard shortcut
http://plugins.jetbrains.com/plugin/6149
Apache License 2.0
105 stars 13 forks source link

Exception - IndexOutOfBounds #42

Open panstromek opened 5 years ago

panstromek commented 5 years ago

Hi.. sorry for not being too descriptive, but I am not really sure how I triggered it.. I couldn't reproduce it again, maybe you will see where is the problem 😉

java.lang.IndexOutOfBoundsException: chars sequence.length:2139, start:2117, end:2116
    at com.intellij.util.text.CharSequenceSubSequence.<init>(CharSequenceSubSequence.java:34)
    at com.intellij.util.text.ImmutableText.subSequence(ImmutableText.java:193)
    at com.intellij.openapi.editor.impl.DocumentImpl$1.subSequence(DocumentImpl.java:106)
    at com.kstenschke.shifter.utils.UtilsTextual.getSubString(UtilsTextual.java:371)
    at com.kstenschke.shifter.models.ActionContainer.<init>(ActionContainer.java:79)
    at com.kstenschke.shifter.actions.ActionAdapter.<init>(ActionAdapter.java:33)
    at com.kstenschke.shifter.actions.ShiftUpMoreAction.actionPerformed(ShiftUpMoreAction.java:38)
    at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:258)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:275)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$1.performAction(IdeKeyEventDispatcher.java:618)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.lambda$processAction$2(IdeKeyEventDispatcher.java:667)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:195)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:666)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.java:519)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.java:474)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:211)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:643)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
panstromek commented 5 years ago

version v1.9.6 , just updated today 😉

udaaff commented 4 years ago

Steps to reproduce:

  1. Setup shortcut ctrl + wheel up, ctrl + wheel down. (maybe unnecessary)
  2. Place your cursor between methods on an empty line.
  3. Key down ctrl and scroll mouse wheel randomly.

Context: typescript file.