Commit Graph
2 Commits
Author SHA1 Message Date
1grzyb1 a4dc442b25 VIM-4379 Do not scan all keys on every keystroke
Key.findKeyByName copies and walks every Key in the application while holding
a global lock. IdeaVim called it several times on every keystroke: from
isIdeaVimDisabledHere (commit window and Kotlin decompiled file checks) and
from the smart step into workaround in VimShortcutKeyAction. On a big project
with many keys this froze the UI. A missing key, e.g. the Kotlin one in an IDE
without Kotlin, was the worst case, because the scan always ran to the end.

NamedKey remembers the key once it is found. While the key is missing, it only
checks keys created since the previous lookup. Key indices only grow, and the
owner may create its key later, when its class is loaded, so this never misses
a new key. The key is held weakly, so it doesn't keep an unloaded plugin alive.

isAllowedFileEditor now runs the cheap and most common checks first, and
isEnabledConsole checks the option before inspecting the editor.
2026-11-17 09:09:30 +01:00
1grzyb1 ef4174295f VIM-4365 Move AIR support into an optional ideavim-air module
The AIR prompt was recognised and handled in several places of the core
by AIR's internal key names and action ids. Everything AIR-specific now
lives in the ideavim-air module, which only loads with the AIR plugin and
implements the new ChatInputProvider extension point. The core asks the
provider whether an editor is a chat prompt, whether the chat owns a key,
and which action breaks a line.

The line-break action is now also used by processEnter, so <C-J>, <C-M>
and mappings ending in <CR> break the line in the AIR prompt. Before,
they ran the platform's Enter action, which AIR turns into a no-op there.
2026-11-02 11:29:02 +01:00