1
0
mirror of https://github.com/chylex/IntelliJ-AceJump.git synced 2024-11-25 17:42:46 +01:00

Compare commits

..

3 Commits

Author SHA1 Message Date
100001ffca
Set version to chylex-13 2023-10-04 02:41:33 +02:00
184896a6cb
Update for IdeaVIM chylex-16 2023-10-04 02:41:05 +02:00
8563400946
Set plugin version to chylex-12 2023-10-04 02:40:51 +02:00
3 changed files with 23 additions and 17 deletions

View File

@ -8,7 +8,7 @@ plugins {
}
group = "org.acejump"
version = "chylex-12"
version = "chylex-13"
repositories {
mavenCentral()
@ -19,9 +19,9 @@ kotlin {
}
intellij {
version.set("2023.1")
version.set("2023.2")
updateSinceUntilBuild.set(false)
plugins.add("IdeaVIM:chylex-15")
plugins.add("IdeaVIM:chylex-16")
pluginsRepositories {
custom("https://intellij.chylex.com")

View File

@ -6,23 +6,19 @@ import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.WriteAction
import com.intellij.openapi.project.DumbAwareAction
import com.maddyhome.idea.vim.KeyHandler
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.action.change.change.ChangeVisualAction
import com.maddyhome.idea.vim.action.change.delete.DeleteVisualAction
import com.maddyhome.idea.vim.action.copy.YankVisualAction
import com.maddyhome.idea.vim.api.injector
import com.maddyhome.idea.vim.command.MappingMode.OP_PENDING
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.command.VimStateMachine
import com.maddyhome.idea.vim.group.visual.vimSetSelection
import com.maddyhome.idea.vim.helper.inVisualMode
import com.maddyhome.idea.vim.helper.vimSelectionStart
import com.maddyhome.idea.vim.helper.vimStateMachine
import com.maddyhome.idea.vim.newapi.vim
import org.acejump.boundaries.StandardBoundaries.AFTER_CARET
import org.acejump.boundaries.StandardBoundaries.BEFORE_CARET
import org.acejump.boundaries.StandardBoundaries.CARET_LINE
import org.acejump.boundaries.StandardBoundaries.VISIBLE_ON_SCREEN
import com.maddyhome.idea.vim.state.mode.SelectionType
import org.acejump.boundaries.StandardBoundaries.*
import org.acejump.modes.JumpMode
import org.acejump.search.Pattern
import org.acejump.search.Tag
@ -49,7 +45,7 @@ sealed class AceVimAction : DumbAwareAction() {
state.act(AceTagAction.JumpToSearchStart, acceptedTag, wasUpperCase, isFinal = true)
if (selectionStart != null) {
caret.vimSetSelection(selectionStart, caret.offset, moveCaretToSelectionEnd = true)
caret.vim.vimSetSelection(selectionStart, caret.offset, moveCaretToSelectionEnd = true)
}
else {
val vim = editor.vim
@ -60,8 +56,8 @@ sealed class AceVimAction : DumbAwareAction() {
commandState.reset()
KeyHandler.getInstance().fullReset(vim)
VimPlugin.getVisualMotion().enterVisualMode(vim, VimStateMachine.SubMode.VISUAL_CHARACTER)
caret.vimSetSelection(caret.offset, initialOffset, moveCaretToSelectionEnd = true)
AceVimUtil.enterVisualMode(vim, SelectionType.CHARACTER_WISE)
caret.vim.vimSetSelection(caret.offset, initialOffset, moveCaretToSelectionEnd = true)
val action = when (key) {
'd' -> DeleteVisualAction()
@ -76,12 +72,9 @@ sealed class AceVimAction : DumbAwareAction() {
commandState.commandBuilder.pushCommandPart(action)
val cmd = commandState.commandBuilder.buildCommand()
val operatorArguments = OperatorArguments(
commandState.mappingState.mappingMode == OP_PENDING,
cmd.rawCount, commandState.mode, commandState.subMode
)
val operatorArguments = OperatorArguments(commandState.mappingState.mappingMode == OP_PENDING, cmd.rawCount, commandState.mode)
commandState.setExecutingCommand(cmd)
commandState.executingCommand = cmd
injector.actionExecutor.executeVimAction(vim, action, context, operatorArguments)
// TODO does not update status
}

View File

@ -0,0 +1,13 @@
package org.acejump.action;
import com.maddyhome.idea.vim.VimPlugin;
import com.maddyhome.idea.vim.api.VimEditor;
import com.maddyhome.idea.vim.state.mode.SelectionType;
final class AceVimUtil {
private AceVimUtil() {}
public static void enterVisualMode(final VimEditor vim, final SelectionType mode) {
VimPlugin.getVisualMotion().enterVisualMode(vim, mode);
}
}