1
0
mirror of https://github.com/chylex/IntelliJ-Keyboard-Master.git synced 2024-10-17 07:42:48 +02:00

Compare commits

...

2 Commits

Author SHA1 Message Date
f814ec04bd
Release version 0.6.1 2024-08-11 11:22:06 +02:00
c7229a6d8e
Fix leaking editor instances 2024-08-11 11:21:49 +02:00
4 changed files with 6 additions and 9 deletions

View File

@ -8,7 +8,7 @@ plugins {
} }
group = "com.chylex.intellij.keyboardmaster" group = "com.chylex.intellij.keyboardmaster"
version = "0.6.0" version = "0.6.1"
repositories { repositories {
mavenCentral() mavenCentral()

View File

@ -27,7 +27,7 @@ object VimNavigation {
fun register() { fun register() {
val disposable = ApplicationManager.getApplication().getService(PluginDisposableService::class.java) val disposable = ApplicationManager.getApplication().getService(PluginDisposableService::class.java)
StartupUiUtil.addAwtListener(::handleEvent, AWTEvent.FOCUS_EVENT_MASK, disposable) StartupUiUtil.addAwtListener(AWTEvent.FOCUS_EVENT_MASK, disposable, ::handleEvent)
UiInterceptors.registerPersistent(disposable, PopupInterceptor) UiInterceptors.registerPersistent(disposable, PopupInterceptor)
} }

View File

@ -1,7 +1,7 @@
package com.chylex.intellij.keyboardmaster.feature.vimNavigation package com.chylex.intellij.keyboardmaster.feature.vimNavigation
import com.chylex.intellij.keyboardmaster.PluginDisposableService
import com.chylex.intellij.keyboardmaster.feature.vimNavigation.VimNavigationDispatcher.WrappedAction.ForKeyListener import com.chylex.intellij.keyboardmaster.feature.vimNavigation.VimNavigationDispatcher.WrappedAction.ForKeyListener
import com.intellij.openapi.Disposable
import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.AnActionEvent
@ -26,11 +26,8 @@ import javax.swing.Action
import javax.swing.JComponent import javax.swing.JComponent
import javax.swing.KeyStroke import javax.swing.KeyStroke
internal open class VimNavigationDispatcher<T : JComponent>(final override val component: T, private val rootNode: KeyStrokeNode.Parent<VimNavigationDispatcher<T>>) : DumbAwareAction(), ComponentHolder { internal open class VimNavigationDispatcher<T : JComponent>(final override val component: T, private val rootNode: KeyStrokeNode.Parent<VimNavigationDispatcher<T>>, disposable: Disposable? = null) : DumbAwareAction(), ComponentHolder {
companion object { companion object {
private val DISPOSABLE
get() = ApplicationManager.getApplication().getService(PluginDisposableService::class.java)
@JvmStatic @JvmStatic
protected val ENTER_KEY: KeyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0) protected val ENTER_KEY: KeyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0)
@ -74,7 +71,7 @@ internal open class VimNavigationDispatcher<T : JComponent>(final override val c
var isSearching = AtomicBoolean(false) var isSearching = AtomicBoolean(false)
init { init {
registerCustomShortcutSet(KeyStrokeNode.getAllShortcuts(getAllKeyStrokes()), component, DISPOSABLE) registerCustomShortcutSet(KeyStrokeNode.getAllShortcuts(getAllKeyStrokes()), component, disposable)
SpeedSearchSupply.getSupply(component, true)?.addChangeListener(::handleSpeedSearchChange) SpeedSearchSupply.getSupply(component, true)?.addChangeListener(::handleSpeedSearchChange)
} }

View File

@ -60,7 +60,7 @@ internal object VimListNavigation {
} }
@Suppress("serial") @Suppress("serial")
private class VimPopupListNavigationDispatcher(component: JList<*>, override val popup: WizardPopup) : VimNavigationDispatcher<JList<*>>(component, POPUP_LIST_ROOT_NODE) { private class VimPopupListNavigationDispatcher(component: JList<*>, override val popup: WizardPopup) : VimNavigationDispatcher<JList<*>>(component, POPUP_LIST_ROOT_NODE, popup.parent) {
init { init {
val speedSearch = SpeedSearchSupply.getSupply(component, true) as? SpeedSearch val speedSearch = SpeedSearchSupply.getSupply(component, true) as? SpeedSearch
if (speedSearch != null) { if (speedSearch != null) {