Skip to content

Commit

Permalink
Log the shortcuts that are assigned to esc and enter
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPl292 committed Nov 22, 2023
1 parent 79d7b7a commit 2f86ac0
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@

package com.maddyhome.idea.vim.handler

import com.intellij.openapi.actionSystem.IdeActions
import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.editor.actionSystem.EditorActionHandlerBean
import com.intellij.openapi.extensions.ExtensionPointName
import com.intellij.openapi.keymap.ex.KeymapManagerEx
import com.intellij.openapi.project.Project
import com.intellij.openapi.startup.StartupActivity

Expand Down Expand Up @@ -40,6 +42,13 @@ internal class EditorHandlersChainLogger : StartupActivity {

LOG.info("Esc handlers chain:\n$escHandlers")
LOG.info("Enter handlers chain:\n$enterHandlers")

val keymapManager = KeymapManagerEx.getInstanceEx()
val keymap = keymapManager.activeKeymap
val keymapShortcutsForEsc = keymap.getShortcuts(IdeActions.ACTION_EDITOR_ESCAPE).joinToString()
val keymapShortcutsForEnter = keymap.getShortcuts(IdeActions.ACTION_EDITOR_ENTER).joinToString()

LOG.info("Active keymap shortcuts for esc: $keymapShortcutsForEsc, Shortcuts for enter: $keymapShortcutsForEnter")
}

companion object {
Expand Down

0 comments on commit 2f86ac0

Please sign in to comment.