diff options
| author | Kyren223 <ulmliad223@gmail.com> | 2024-05-09 18:09:24 +0300 |
|---|---|---|
| committer | Kyren223 <ulmliad223@gmail.com> | 2024-05-09 18:09:24 +0300 |
| commit | 9b9c0f0594209b8c4ecdb7901293734ccf567437 (patch) | |
| tree | 0843cb07aa00ce80418f01a1ad083f72e45d7d93 /src/main/kotlin/me/kyren223/trident/actions | |
| parent | 1e30fa7ded9939fa45a45f82f84c1e8cd95d68aa (diff) | |
Finished implementing all the settings, mapping menu, trident list menu, and fixed all the bugs/issues.
Added more index actions for a total of 10 actions (compared to the original 4).
Updated README.md and TODO.md.
Changed version to 2.0.0.
Versions now follow the semver standard. which means that for each major version there will be backwards incompatible changes. for minor versions there will be new features and bug fixes. and for patch versions there will be bug fixes only.
Diffstat (limited to 'src/main/kotlin/me/kyren223/trident/actions')
| -rw-r--r-- | src/main/kotlin/me/kyren223/trident/actions/TridentAppendAction.kt (renamed from src/main/kotlin/me/kyren223/trident/actions/AppendAction.kt) | 2 | ||||
| -rw-r--r-- | src/main/kotlin/me/kyren223/trident/actions/TridentListAction.kt | 20 | ||||
| -rw-r--r-- | src/main/kotlin/me/kyren223/trident/actions/TridentListSelectAction.kt | 5 | ||||
| -rw-r--r-- | src/main/kotlin/me/kyren223/trident/actions/TridentSelectAction.kt (renamed from src/main/kotlin/me/kyren223/trident/actions/SelectAction.kt) | 4 |
4 files changed, 4 insertions, 27 deletions
diff --git a/src/main/kotlin/me/kyren223/trident/actions/AppendAction.kt b/src/main/kotlin/me/kyren223/trident/actions/TridentAppendAction.kt index 1b9a2b4..1b0d33a 100644 --- a/src/main/kotlin/me/kyren223/trident/actions/AppendAction.kt +++ b/src/main/kotlin/me/kyren223/trident/actions/TridentAppendAction.kt @@ -7,7 +7,7 @@ import com.intellij.openapi.project.Project import com.intellij.openapi.vfs.VirtualFile import me.kyren223.trident.utils.TridentList -class AppendAction : AnAction() { +class TridentAppendAction : AnAction() { override fun actionPerformed(e: AnActionEvent) { val project: Project = e.project ?: return val file: VirtualFile = e.getData(PlatformDataKeys.VIRTUAL_FILE) ?: return diff --git a/src/main/kotlin/me/kyren223/trident/actions/TridentListAction.kt b/src/main/kotlin/me/kyren223/trident/actions/TridentListAction.kt index cef0bf2..0d733f3 100644 --- a/src/main/kotlin/me/kyren223/trident/actions/TridentListAction.kt +++ b/src/main/kotlin/me/kyren223/trident/actions/TridentListAction.kt @@ -2,32 +2,12 @@ package me.kyren223.trident.actions import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent -import com.maddyhome.idea.vim.api.injector -import com.maddyhome.idea.vim.command.MappingMode -import com.maddyhome.idea.vim.key.MappingOwner -import me.kyren223.trident.data.SettingsState import me.kyren223.trident.ui.TridentListMenu class TridentListAction : AnAction() { override fun actionPerformed(e: AnActionEvent) { - if (!remapped) remap() val project = e.project ?: return TridentListMenu.open(project) } - // TODO move the remap to somewhere else - private fun remap() { - if (!SettingsState.instance.enterToSelect) return - val keys = injector.parser.parseKeys(":action TridentQuickMenuSelect<cr>") - val keyGroup = injector.keyGroup - keyGroup.putKeyMapping(MappingMode.NVO, - injector.parser.parseKeys("<cr>"), - MappingOwner.Plugin.get("Trident"), keys, false - ) - remapped = true - } - - companion object { - var remapped = false - } } diff --git a/src/main/kotlin/me/kyren223/trident/actions/TridentListSelectAction.kt b/src/main/kotlin/me/kyren223/trident/actions/TridentListSelectAction.kt index d1dfd2d..1b68a59 100644 --- a/src/main/kotlin/me/kyren223/trident/actions/TridentListSelectAction.kt +++ b/src/main/kotlin/me/kyren223/trident/actions/TridentListSelectAction.kt @@ -3,12 +3,9 @@ package me.kyren223.trident.actions import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import me.kyren223.trident.ui.TridentListMenu -import me.kyren223.trident.utils.TridentList class TridentListSelectAction : AnAction() { override fun actionPerformed(e: AnActionEvent) { - val project = e.project ?: return - TridentList.select(project, TridentListMenu.line) + TridentListMenu.instance?.select() } - } diff --git a/src/main/kotlin/me/kyren223/trident/actions/SelectAction.kt b/src/main/kotlin/me/kyren223/trident/actions/TridentSelectAction.kt index 37617c4..60973f2 100644 --- a/src/main/kotlin/me/kyren223/trident/actions/SelectAction.kt +++ b/src/main/kotlin/me/kyren223/trident/actions/TridentSelectAction.kt @@ -6,10 +6,10 @@ import com.intellij.openapi.actionSystem.PlatformDataKeys import com.intellij.openapi.fileEditor.FileEditorManager import me.kyren223.trident.utils.TridentList -class SelectAction : AnAction() { +class TridentSelectAction : AnAction() { override fun actionPerformed(e: AnActionEvent) { val project = e.project ?: return - var index = when (val actionId = e.actionManager.getId(this)) { + val index = when (val actionId = e.actionManager.getId(this)) { NEXT -> { val file = e.getData(PlatformDataKeys.VIRTUAL_FILE) ?: return val current = TridentList.getIndexOfFile(project, file) ?: return |
