mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2026-11-26 15:19:10 +01:00
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.