Skip to content

Commit ec48673

Browse files
committed
Fix typing issue on sub input
1 parent 6871674 commit ec48673

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pluginGroup = com.devfive.vim_switch_ko
44
pluginName = vim-switch-ko
55
pluginRepositoryUrl = https://github.com/owjs3901/vim-switch-ko
66
# SemVer format -> https://semver.org
7-
pluginVersion = 0.0.3
7+
pluginVersion = 0.0.4
88

99
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
1010
pluginSinceBuild = 223

src/main/kotlin/com/devfive/vim_switch_ko/VimSwitchKoListener.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import com.intellij.ide.plugins.PluginManager
55
import com.intellij.ide.plugins.cl.PluginAwareClassLoader
66
import com.intellij.openapi.editor.impl.EditorComponentImpl
77
import com.intellij.openapi.extensions.PluginId
8-
import com.intellij.openapi.fileEditor.FileEditorManager
98
import com.intellij.openapi.project.DumbAware
109
import com.intellij.openapi.project.Project
1110
import com.intellij.openapi.startup.ProjectActivity
@@ -54,7 +53,12 @@ internal class VimSwitchKoListener : ProjectActivity, DumbAware {
5453
if (editors == null)
5554
return false
5655
}
57-
val currentFile = (FocusManager.getCurrentManager().focusOwner as EditorComponentImpl).editor.virtualFile.path
56+
if (FocusManager.getCurrentManager().focusOwner !is EditorComponentImpl)
57+
return false
58+
val virtualFile = (FocusManager.getCurrentManager().focusOwner as EditorComponentImpl).editor.virtualFile
59+
?: return false
60+
val currentFile =
61+
virtualFile.path
5862
for (editor in editors!!) {
5963
val virtualFilePath = editor.javaClass.getMethod("getPath").invoke(editor)
6064
if (virtualFilePath == currentFile) {

0 commit comments

Comments
 (0)