From 7451f83d6685073d10df9bae5c957fdb55dcdc53 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Fri, 23 Aug 2024 00:31:20 +0300 Subject: fix: issues with IdeaVim version 2.16.0, everything should work now --- src/main/kotlin/me/kyren223/trident/utils/Utils.kt | 42 +++++++++------------- 1 file changed, 16 insertions(+), 26 deletions(-) (limited to 'src/main/kotlin/me/kyren223/trident/utils/Utils.kt') diff --git a/src/main/kotlin/me/kyren223/trident/utils/Utils.kt b/src/main/kotlin/me/kyren223/trident/utils/Utils.kt index e688dd8..d9b4f34 100644 --- a/src/main/kotlin/me/kyren223/trident/utils/Utils.kt +++ b/src/main/kotlin/me/kyren223/trident/utils/Utils.kt @@ -1,26 +1,16 @@ -package me.kyren223.trident.utils - -import com.maddyhome.idea.vim.api.VimEditor -import com.maddyhome.idea.vim.api.injector -import com.maddyhome.idea.vim.command.MappingMode -import com.maddyhome.idea.vim.command.OperatorArguments -import com.maddyhome.idea.vim.key.MappingOwner -import com.maddyhome.idea.vim.state.mode.Mode - -fun setEditorMode(editor: VimEditor, mode: Mode) { - val context = injector.executionContextManager.onEditor(editor, null) - val operatorArguments = OperatorArguments(false, 0, mode) - editor.exitInsertMode(context, operatorArguments) - editor.vimChangeActionSwitchMode = Mode.NORMAL() -} - -fun injectEnterToSelectMapping() { - injector.keyGroup.putKeyMapping( - MappingMode.NV, - injector.parser.parseKeys(""), - MappingOwner.Plugin.get("Trident"), - injector.parser.parseKeys(":action TridentListSelect"), - false - ) -} - +package me.kyren223.trident.utils + +import com.maddyhome.idea.vim.api.injector +import com.maddyhome.idea.vim.command.MappingMode +import com.maddyhome.idea.vim.key.MappingOwner + +fun injectEnterToSelectMapping() { + injector.keyGroup.putKeyMapping( + MappingMode.NV, + injector.parser.parseKeys(""), + MappingOwner.Plugin.get("Trident"), + injector.parser.parseKeys(":action TridentListSelect"), + false + ) +} + -- cgit v1.3.1