feat: add default keymap for edit code action

This commit is contained in:
Carl-Robert Linnupuu 2024-06-30 01:15:00 +03:00
parent b1d8c521c4
commit db3f4ac98c

View file

@ -1,11 +1,15 @@
package ee.carlrobert.codegpt.actions.editor
import com.intellij.openapi.actionSystem.CustomShortcutSet
import com.intellij.openapi.application.runInEdt
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import ee.carlrobert.codegpt.Icons
import ee.carlrobert.codegpt.ui.EditCodePopover
import java.awt.event.InputEvent
import java.awt.event.KeyEvent
import javax.swing.Icon
import javax.swing.KeyStroke
class EditCodeAction : BaseEditorAction {
@ -16,6 +20,14 @@ class EditCodeAction : BaseEditorAction {
"Allow LLM to edit code directly in your editor",
icon
) {
registerCustomShortcutSet(
CustomShortcutSet(
KeyStroke.getKeyStroke(
KeyEvent.VK_E,
InputEvent.SHIFT_DOWN_MASK or InputEvent.META_DOWN_MASK
)
), null
)
EditorActionsUtil.registerAction(this)
}