mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-05-28 16:34:10 +02:00
Fix problem with unsatisfied condition
This commit is contained in:
parent
bfb1d5b7f5
commit
1e0fa07768
@ -13,6 +13,7 @@ import com.intellij.openapi.editor.Editor
|
|||||||
import com.intellij.testFramework.PlatformTestUtil
|
import com.intellij.testFramework.PlatformTestUtil
|
||||||
import com.maddyhome.idea.vim.KeyHandler
|
import com.maddyhome.idea.vim.KeyHandler
|
||||||
import com.maddyhome.idea.vim.api.injector
|
import com.maddyhome.idea.vim.api.injector
|
||||||
|
import com.maddyhome.idea.vim.api.key
|
||||||
import com.maddyhome.idea.vim.key.CommandNode
|
import com.maddyhome.idea.vim.key.CommandNode
|
||||||
import com.maddyhome.idea.vim.newapi.vim
|
import com.maddyhome.idea.vim.newapi.vim
|
||||||
import org.jetbrains.jetCheck.Generator
|
import org.jetbrains.jetCheck.Generator
|
||||||
@ -93,7 +94,8 @@ private class AvailableActions(private val editor: Editor) : ImperativeCommand {
|
|||||||
override fun performCommand(env: ImperativeCommand.Environment) {
|
override fun performCommand(env: ImperativeCommand.Environment) {
|
||||||
val currentNode = KeyHandler.getInstance().keyHandlerState.commandBuilder.getCurrentTrie()
|
val currentNode = KeyHandler.getInstance().keyHandlerState.commandBuilder.getCurrentTrie()
|
||||||
|
|
||||||
val possibleKeys = currentNode.keys.toList().sortedBy { injector.parser.toKeyNotation(it) }
|
// Note: esc is always an option
|
||||||
|
val possibleKeys = (currentNode.keys.toList() + esc).sortedBy { injector.parser.toKeyNotation(it) }
|
||||||
println("Keys: ${possibleKeys.joinToString(", ")}")
|
println("Keys: ${possibleKeys.joinToString(", ")}")
|
||||||
val keyGenerator = Generator.integers(0, possibleKeys.lastIndex)
|
val keyGenerator = Generator.integers(0, possibleKeys.lastIndex)
|
||||||
.suchThat { injector.parser.toKeyNotation(possibleKeys[it]) !in stinkyKeysList }
|
.suchThat { injector.parser.toKeyNotation(possibleKeys[it]) !in stinkyKeysList }
|
||||||
@ -108,6 +110,8 @@ private class AvailableActions(private val editor: Editor) : ImperativeCommand {
|
|||||||
IdeEventQueue.getInstance().flushQueue()
|
IdeEventQueue.getInstance().flushQueue()
|
||||||
PlatformTestUtil.dispatchAllInvocationEventsInIdeEventQueue()
|
PlatformTestUtil.dispatchAllInvocationEventsInIdeEventQueue()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private val esc = key("<Esc>")
|
||||||
}
|
}
|
||||||
|
|
||||||
private val stinkyKeysList = arrayListOf(
|
private val stinkyKeysList = arrayListOf(
|
||||||
|
Loading…
Reference in New Issue
Block a user