dkandalov / tab-shifter

Plugin for IntelliJ IDEA to move and split editor tabs
https://plugins.jetbrains.com/plugin/7475
169 stars 12 forks source link

NullPointerException in 2023.3 RC #36

Closed tedyoung closed 9 months ago

tedyoung commented 9 months ago

Might be related to #33

Happens when attempting to move an editor pane from the left to the right group (or vice-versa).

java.lang.NullPointerException
    at tabshifter.Ide.snapshotWindowLayout(Ide.kt:83)
    at tabshifter.Ide.snapshotWindowLayout(Ide.kt:69)
    at tabshifter.TabShifterKt.windowLayoutSnapshotWithPositions(TabShifter.kt:107)
    at tabshifter.TabShifterKt.access$windowLayoutSnapshotWithPositions(TabShifter.kt:1)
    at tabshifter.TabShifter.moveTab(TabShifter.kt:28)
    at tabshifter.Actions$ShiftRight.actionPerformed(Actions.kt:31)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:344)
    at com.intellij.openapi.keymap.impl.ActionProcessor.performAction(ActionProcessor.java:32)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$myActionProcessor$1.performAction(IdeKeyEventDispatcher.kt:496)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$4$lambda$3(IdeKeyEventDispatcher.kt:831)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:95)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$4(IdeKeyEventDispatcher.kt:831)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:381)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner(IdeKeyEventDispatcher.kt:829)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.access$doPerformActionInner(IdeKeyEventDispatcher.kt:1)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction$intellij_platform_ide_impl(IdeKeyEventDispatcher.kt:559)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.kt:509)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.kt:448)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.kt:441)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.kt:303)
    at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.kt:620)
    at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$11(IdeEventQueue.kt:581)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:75)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:67)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:581)
    at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:72)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:355)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:354)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:793)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:354)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:349)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1014)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:114)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1014)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:349)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:848)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:391)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
cpouldev commented 9 months ago

I have the same problem too using 2023.3 stable (released today)

dkandalov commented 9 months ago

Sorry for the slow response (I don't use this plugin myself anymore). I have a fix, will release it soon.

cpouldev commented 9 months ago

Thanks a lot!

In case it breaks again in the future, these are the relevant (not completely though) native actions from jetbrains to get the job done.

nmap <leader>h <Action>(NextSplitter)
nmap <leader>l <Action>(NextSplitter)
"nmap <leader>h <Action>(TabShiftActions.MoveFocusLeft)
"nmap <leader>l <Action>(TabShiftActions.MoveFocusRight)
"nmap <leader>k <Action>(TabShiftActions.MoveFocusUp)
"nmap <leader>j <Action>(TabShiftActions.MoveFocusDown)

nmap <leader>H <Action>(MoveEditorToOppositeTabGroup)
nmap <leader>L <Action>(MoveEditorToOppositeTabGroup)
"nmap <leader>H <Action>(TabShiftActions.ShiftLeft)
"nmap <leader>L <Action>(TabShiftActions.ShiftRight)
"nmap <leader>K <Action>(TabShiftActions.ShiftUp)
"nmap <leader>J <Action>(TabShiftActions.ShiftDown)

nmap <C-A-h> <Action>(StretchSplitToLeft)
nmap <C-A-l> <Action>(StretchSplitToRight)
nmap <C-A-k> <Action>(StretchSplitToUp)
nmap <C-A-j> <Action>(StretchSplitToDown)
psy901 commented 9 months ago

Sorry for the slow response (I don't use this plugin myself anymore). I have a fix, will release it soon.

thanks for the fix 👍 Tab Shifter is awesome, and it makes using Intellij so much easier

ristomatti commented 9 months ago

Thank you! 🙇

ristomatti commented 9 months ago

The issue got fixed with the new release, I assume this can be closed?