romaindalichamp/TerminalTabTailor

Throws errors if no file/directory was selected in the tree

Closed this issue · 3 comments

iRay commented

When a file that is being edited was opened directly via "double shift" and therefore no any file/directory
was selected in the directory tree then we're getting the error:

Caused by: kotlin.UninitializedPropertyAccessException: lateinit property lastSelectedVirtualFile has not been initialized
	at com.terminaltabtailor.listeners.ProjectTreeSelectionListener$Companion.getLastSelectedVirtualFile(ProjectTreeSelectionListener.kt:15)
	at com.terminaltabtailor.managers.TerminalTabNamesManager.constructNewTabName(TerminalTabNamesManager.kt:30)
	at com.terminaltabtailor.managers.TerminalTabNamesManager.renameTerminalTab(TerminalTabNamesManager.kt:25)
	at com.terminaltabtailor.listeners.TerminalActionListener.afterActionPerformed(TerminalActionListener.kt:16)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:700)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:664)

And all newly opened console tabs are named as "local".
After clearing the error message it doesn't appear anymore(before ide restart)

Hey iRay,

Thank you very much for your feedback regarding this issue. I've recently resolved an issue indirectly related to this, so the error at least for this should be removed in version 1.1.0. This update is currently undergoing JetBrains' review process and is expected to be available on the marketplace within a few days.

For the "double shift" issue when no selection was done before, it is a very good point, and i will have a closer look to this.

The code for the other issue has been merged into the master branch and if you want the new version including the fix before it's official release, you can download the version 1.1.0 as a Jar here: https://plugins.jetbrains.com/plugin/23903-terminal-tab-tailor/versions/in%20review

To install, you can copy/paste the downloaded Jar to the Plugins directory following the instructions here (and remove the previous version): https://www.jetbrains.com/help/idea/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#plugins-directory

Please let me know if this resolves the error message for you :)

Romain

Hey iRay,

The issue has been resolved in version 1.1.1. As previously mentioned for version 1.1.0, it's immediately available at the following link and will be officially released on the marketplace shortly: https://plugins.jetbrains.com/plugin/23903-terminal-tab-tailor/versions/in%20review

This GitHub issue was automatically closed with the merge of my Pull Request, but please let me know whether the solution works for you, if not please don't hesitate to tell me here and i will reopen, or open another ticket.

Thank you again for bringing this bug to my attention 👍

Romain

iRay commented

@romaindalichamp I've checked the new version and it works like a expected)
Thank you for such a fast fix!
I've a suggestion: at the moment if we open a tab that was previously opened for a certain directory it creates a duplicate tab(e.g.: api (2)).
It would be great to have an option in the settings that will not create a new tab if there is already the same one.