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

Compare commits

..

1 Commits

Author SHA1 Message Date
6de52d21b6
Set Set plugin version to chylex-12 2023-07-28 08:00:44 +02:00
3 changed files with 17 additions and 23 deletions

View File

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

View File

@ -6,19 +6,23 @@ 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 com.maddyhome.idea.vim.state.mode.SelectionType
import org.acejump.boundaries.StandardBoundaries.*
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 org.acejump.modes.JumpMode
import org.acejump.search.Pattern
import org.acejump.search.Tag
@ -45,7 +49,7 @@ sealed class AceVimAction : DumbAwareAction() {
state.act(AceTagAction.JumpToSearchStart, acceptedTag, wasUpperCase, isFinal = true)
if (selectionStart != null) {
caret.vim.vimSetSelection(selectionStart, caret.offset, moveCaretToSelectionEnd = true)
caret.vimSetSelection(selectionStart, caret.offset, moveCaretToSelectionEnd = true)
}
else {
val vim = editor.vim
@ -56,8 +60,8 @@ sealed class AceVimAction : DumbAwareAction() {
commandState.reset()
KeyHandler.getInstance().fullReset(vim)
AceVimUtil.enterVisualMode(vim, SelectionType.CHARACTER_WISE)
caret.vim.vimSetSelection(caret.offset, initialOffset, moveCaretToSelectionEnd = true)
VimPlugin.getVisualMotion().enterVisualMode(vim, VimStateMachine.SubMode.VISUAL_CHARACTER)
caret.vimSetSelection(caret.offset, initialOffset, moveCaretToSelectionEnd = true)
val action = when (key) {
'd' -> DeleteVisualAction()
@ -72,9 +76,12 @@ 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)
val operatorArguments = OperatorArguments(
commandState.mappingState.mappingMode == OP_PENDING,
cmd.rawCount, commandState.mode, commandState.subMode
)
commandState.executingCommand = cmd
commandState.setExecutingCommand(cmd)
injector.actionExecutor.executeVimAction(vim, action, context, operatorArguments)
// TODO does not update status
}

View File

@ -1,13 +0,0 @@
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);
}
}