mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2026-11-26 15:19:10 +01:00
With "Override IDE shortcuts" on, the terminal sends every key to the shell from its own IdeEventQueue dispatcher, unless the key is the keymap shortcut of an action on its allowlist. The <C-W> shortcuts of ToolWindowNavDispatcher are registered on the component, not in the keymap, so in the terminal <C-W> deleted a word in the shell and the direction key was typed there too. A queue dispatcher of our own now runs before the terminal's one and, while the focus is in the Terminal tool window, gives the keys of a <C-W> sequence to ToolWindowNavDispatcher directly. Going through the action system doesn't work there: for the keys on the terminal's allowlist, such as the arrows or Enter, the terminal's own action wins, and plain letters aren't shortcuts in an editable editor. The terminal adds its dispatcher whenever it gets the focus, so ours is added when VimEverywhere starts. The test runs the terminal's real key dispatcher, so it fails if the terminal starts to take the keys before the dispatchers added earlier.