Skip to content

Commit

Permalink
Fix(VIM-3584): com.maddyhome.idea.vim.KeyHandler requests `com.mad…
Browse files Browse the repository at this point in the history
…dyhome.idea.vim.api.VimKeyGroup` instance. Class initialization must not depend on services
  • Loading branch information
lippfi committed Aug 10, 2024
1 parent 1a2322d commit 8c9ff94
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions vim-engine/src/main/kotlin/com/maddyhome/idea/vim/KeyHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,15 @@ class KeyHandler {
private val keyConsumers: List<KeyConsumer> = listOf(ModalInputConsumer(), MappingProcessor, CommandCountConsumer(), DeleteCommandConsumer(), EditorResetConsumer(), CharArgumentConsumer(), RegisterConsumer(), DigraphConsumer(), CommandConsumer(), SelectRegisterConsumer(), ModeInputConsumer())
private var handleKeyRecursionCount = 0

var keyHandlerState: KeyHandlerState = KeyHandlerState()
private set
// KeyHandlerState requires injector.keyGroup to be initialized and that's why we don't create it immediately and have this here
// TODO figure out a better solution
private val defaultKeyHandlerState by lazy { KeyHandlerState() }
private var mutableKeyHandlerState: KeyHandlerState? = null
var keyHandlerState: KeyHandlerState
get() = mutableKeyHandlerState ?: defaultKeyHandlerState
private set(value) {
mutableKeyHandlerState = value
}

val keyStack: KeyStack = KeyStack()
val modalEntryKeys: MutableList<KeyStroke> = ArrayList()
Expand Down

0 comments on commit 8c9ff94

Please sign in to comment.