mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2024-11-24 22:42:53 +01:00
Compare commits
19 Commits
0fbe675373
...
3da1cc300f
Author | SHA1 | Date | |
---|---|---|---|
3da1cc300f | |||
4d535c4148 | |||
5768209a33 | |||
fe0f4fde9d | |||
25e4eb9078 | |||
9b507e6033 | |||
4d0a54221a | |||
17d49bc35d | |||
ba9966d996 | |||
ae1cb45854 | |||
27c8d9e610 | |||
5a247843e4 | |||
4438c654d0 | |||
705530fdfd | |||
a1c0cfda52 | |||
9261d17491 | |||
c89099bb0c | |||
00f73f52bd | |||
b0474cec7d |
@ -125,7 +125,6 @@ dependencies {
|
|||||||
|
|
||||||
// AceJump is an optional dependency. We use their SessionManager class to check if it's active
|
// AceJump is an optional dependency. We use their SessionManager class to check if it's active
|
||||||
plugin("AceJump", "3.8.19")
|
plugin("AceJump", "3.8.19")
|
||||||
plugin("com.intellij.classic.ui", "242.20224.159")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
moduleSources(project(":vim-engine", "sourcesJarArtifacts"))
|
moduleSources(project(":vim-engine", "sourcesJarArtifacts"))
|
||||||
@ -211,8 +210,6 @@ tasks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compileTestKotlin {
|
compileTestKotlin {
|
||||||
enabled = false
|
|
||||||
|
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = javaVersion
|
jvmTarget = javaVersion
|
||||||
apiVersion = "1.9"
|
apiVersion = "1.9"
|
||||||
|
@ -20,7 +20,7 @@ ideaVersion=2024.2
|
|||||||
# Values for type: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#intellij-extension-type
|
# Values for type: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#intellij-extension-type
|
||||||
ideaType=IC
|
ideaType=IC
|
||||||
instrumentPluginCode=true
|
instrumentPluginCode=true
|
||||||
version=chylex-39
|
version=chylex-38
|
||||||
javaVersion=17
|
javaVersion=17
|
||||||
remoteRobotVersion=0.11.23
|
remoteRobotVersion=0.11.23
|
||||||
antlrVersion=4.10.1
|
antlrVersion=4.10.1
|
||||||
|
@ -1,52 +0,0 @@
|
|||||||
package com.maddyhome.idea.vim.action
|
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.ActionUpdateThread
|
|
||||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
|
||||||
import com.intellij.openapi.command.UndoConfirmationPolicy
|
|
||||||
import com.intellij.openapi.command.WriteCommandAction
|
|
||||||
import com.intellij.openapi.fileEditor.TextEditor
|
|
||||||
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx
|
|
||||||
import com.intellij.openapi.project.DumbAwareAction
|
|
||||||
import com.maddyhome.idea.vim.KeyHandler
|
|
||||||
import com.maddyhome.idea.vim.api.injector
|
|
||||||
import com.maddyhome.idea.vim.newapi.IjEditorExecutionContext
|
|
||||||
import com.maddyhome.idea.vim.newapi.vim
|
|
||||||
import com.maddyhome.idea.vim.state.mode.Mode
|
|
||||||
|
|
||||||
class VimRunLastMacroInOpenFiles : DumbAwareAction() {
|
|
||||||
override fun update(e: AnActionEvent) {
|
|
||||||
val lastRegister = injector.macro.lastRegister
|
|
||||||
val isEnabled = lastRegister != 0.toChar()
|
|
||||||
|
|
||||||
e.presentation.isEnabled = isEnabled
|
|
||||||
e.presentation.text = if (isEnabled) "Run Macro '${lastRegister}' in Open Files" else "Run Last Macro in Open Files"
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getActionUpdateThread(): ActionUpdateThread {
|
|
||||||
return ActionUpdateThread.EDT
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun actionPerformed(e: AnActionEvent) {
|
|
||||||
val project = e.project ?: return
|
|
||||||
val fileEditorManager = FileEditorManagerEx.getInstanceExIfCreated(project) ?: return
|
|
||||||
val editors = fileEditorManager.allEditors.filterIsInstance<TextEditor>()
|
|
||||||
|
|
||||||
WriteCommandAction.writeCommandAction(project)
|
|
||||||
.withName(e.presentation.text)
|
|
||||||
.withGlobalUndo()
|
|
||||||
.withUndoConfirmationPolicy(UndoConfirmationPolicy.REQUEST_CONFIRMATION)
|
|
||||||
.run<RuntimeException> {
|
|
||||||
val reg = injector.macro.lastRegister
|
|
||||||
|
|
||||||
for (editor in editors) {
|
|
||||||
fileEditorManager.openFile(editor.file, true)
|
|
||||||
|
|
||||||
val vimEditor = editor.editor.vim
|
|
||||||
vimEditor.mode = Mode.NORMAL()
|
|
||||||
KeyHandler.getInstance().reset(vimEditor)
|
|
||||||
|
|
||||||
injector.macro.playbackRegister(vimEditor, IjEditorExecutionContext(e.dataContext), reg, 1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -23,10 +23,7 @@ import com.maddyhome.idea.vim.EventFacade;
|
|||||||
import com.maddyhome.idea.vim.KeyHandler;
|
import com.maddyhome.idea.vim.KeyHandler;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimShortcutKeyAction;
|
import com.maddyhome.idea.vim.action.VimShortcutKeyAction;
|
||||||
import com.maddyhome.idea.vim.api.VimCommandLine;
|
import com.maddyhome.idea.vim.api.*;
|
||||||
import com.maddyhome.idea.vim.api.VimCommandLineCaret;
|
|
||||||
import com.maddyhome.idea.vim.api.VimEditor;
|
|
||||||
import com.maddyhome.idea.vim.api.VimKeyGroupBase;
|
|
||||||
import com.maddyhome.idea.vim.ex.ranges.LineRange;
|
import com.maddyhome.idea.vim.ex.ranges.LineRange;
|
||||||
import com.maddyhome.idea.vim.helper.SearchHighlightsHelper;
|
import com.maddyhome.idea.vim.helper.SearchHighlightsHelper;
|
||||||
import com.maddyhome.idea.vim.helper.UiHelper;
|
import com.maddyhome.idea.vim.helper.UiHelper;
|
||||||
@ -351,7 +348,7 @@ public class ExEntryPanel extends JPanel implements VimCommandLine {
|
|||||||
// coerced to at least 1.
|
// coerced to at least 1.
|
||||||
int count1 = KeyHandler.getInstance().getKeyHandlerState().getEditorCommandBuilder().getAggregatedUncommittedCount();
|
int count1 = KeyHandler.getInstance().getKeyHandlerState().getEditorCommandBuilder().getAggregatedUncommittedCount();
|
||||||
|
|
||||||
if ((labelText.equals("/") || labelText.equals("?") || searchCommand) && !injector.getMacro().isExecutingMacro()) {
|
if (labelText.equals("/") || labelText.equals("?") || searchCommand) {
|
||||||
final boolean forwards = !labelText.equals("?"); // :s, :g, :v are treated as forwards
|
final boolean forwards = !labelText.equals("?"); // :s, :g, :v are treated as forwards
|
||||||
int pattenEnd = injector.getSearchGroup().findEndOfPattern(searchText, separator, 0);
|
int pattenEnd = injector.getSearchGroup().findEndOfPattern(searchText, separator, 0);
|
||||||
final String pattern = searchText.substring(0, pattenEnd);
|
final String pattern = searchText.substring(0, pattenEnd);
|
||||||
|
@ -125,11 +125,9 @@
|
|||||||
<xi:include href="/META-INF/includes/VimListeners.xml" xpointer="xpointer(/idea-plugin/*)"/>
|
<xi:include href="/META-INF/includes/VimListeners.xml" xpointer="xpointer(/idea-plugin/*)"/>
|
||||||
|
|
||||||
<actions resource-bundle="messages.IdeaVimBundle">
|
<actions resource-bundle="messages.IdeaVimBundle">
|
||||||
<group id="com.chylex.intellij.vim" text="Vim" popup="true">
|
<action id="VimPluginToggle" class="com.maddyhome.idea.vim.action.VimPluginToggleAction">
|
||||||
<add-to-group group-id="ToolsMenu" anchor="last"/>
|
<add-to-group group-id="ToolsMenu" anchor="last"/>
|
||||||
<action id="VimPluginToggle" class="com.maddyhome.idea.vim.action.VimPluginToggleAction"/>
|
</action>
|
||||||
<action id="VimRunLastMacroInOpenFiles" class="com.maddyhome.idea.vim.action.VimRunLastMacroInOpenFiles"/>
|
|
||||||
</group>
|
|
||||||
|
|
||||||
<!-- Internal -->
|
<!-- Internal -->
|
||||||
<!--suppress PluginXmlI18n -->
|
<!--suppress PluginXmlI18n -->
|
||||||
|
@ -68,7 +68,8 @@ class ProcessSearchEntryAction(private val parentAction: ProcessExEntryAction) :
|
|||||||
'?' -> injector.searchGroup.processSearchCommand(editor, argument.string, caret.offset, operatorArguments.count1, Direction.BACKWARDS)
|
'?' -> injector.searchGroup.processSearchCommand(editor, argument.string, caret.offset, operatorArguments.count1, Direction.BACKWARDS)
|
||||||
else -> throw ExException("Unexpected search label ${argument.character}")
|
else -> throw ExException("Unexpected search label ${argument.character}")
|
||||||
}
|
}
|
||||||
if (offsetAndMotion == null) return Motion.Error
|
// Vim doesn't treat not finding something as an error, although it might report either an error or warning message
|
||||||
|
if (offsetAndMotion == null) return Motion.NoMotion
|
||||||
parentAction.motionType = offsetAndMotion.second
|
parentAction.motionType = offsetAndMotion.second
|
||||||
return offsetAndMotion.first.toMotionOrError()
|
return offsetAndMotion.first.toMotionOrError()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user