1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-05-07 05:34:02 +02:00

Bump the minimal version of IJ to 241

There are a lot of incompatibilities with IdeaVim on 241 if it's built on 233

Also, this time the special branch for the IJ version won't be created. Previously on bumping the version of IJ, we've created the branch to keep the reference to the moment when it happened. However, IJ version bumps are easy to trace anyway by git.
This commit is contained in:
Alex Plate 2024-05-24 15:36:49 +03:00
parent 33a5480456
commit 1a7e90c7d7
No known key found for this signature in database
GPG Key ID: 0B97153C8FFEC09F
6 changed files with 9 additions and 75 deletions
.idea
.teamcity/_Self
build.gradle.ktsgradle.properties
src/main
java/com/maddyhome/idea/vim/helper
resources/META-INF

View File

@ -11,6 +11,6 @@
</option>
</component>
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -24,8 +24,7 @@ object Project : Project({
// Active tests
buildType(TestingBuildType("Latest EAP", "<default>", version = "LATEST-EAP-SNAPSHOT"))
buildType(TestingBuildType("2023.3", "<default>", version = "2023.3"))
buildType(TestingBuildType("2024.1", "<default>"))
buildType(TestingBuildType("2024.1.1", "<default>"))
buildType(TestingBuildType("Latest EAP With Xorg", "<default>", version = "LATEST-EAP-SNAPSHOT"))
buildType(PropertyBased)

View File

@ -310,7 +310,7 @@ tasks {
patchPluginXml {
// Don't forget to update plugin.xml
sinceBuild.set("233.11799.241")
sinceBuild.set("241.15989.150")
changeNotes.set(
"""<a href="https://youtrack.jetbrains.com/issues/VIM?q=State:%20Fixed%20Fix%20versions:%20${version.get()}">Changelog</a>"""

View File

@ -9,7 +9,7 @@
# suppress inspection "UnusedProperty" for whole file
#ideaVersion=LATEST-EAP-SNAPSHOT
ideaVersion=2024.1
ideaVersion=2024.1.1
# Values for type: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#intellij-extension-type
ideaType=IC
downloadIdeaSources=true

View File

@ -10,7 +10,6 @@ package com.maddyhome.idea.vim.helper
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.actionSystem.PlatformDataKeys
import com.intellij.openapi.application.ApplicationInfo
import com.intellij.openapi.command.CommandProcessor
import com.intellij.openapi.command.undo.UndoManager
import com.intellij.openapi.components.Service
@ -21,7 +20,6 @@ import com.maddyhome.idea.vim.api.ExecutionContext
import com.maddyhome.idea.vim.api.VimEditor
import com.maddyhome.idea.vim.api.injector
import com.maddyhome.idea.vim.common.ChangesListener
import com.maddyhome.idea.vim.listener.SelectionVimListenerSuppressor
import com.maddyhome.idea.vim.newapi.globalIjOptions
import com.maddyhome.idea.vim.newapi.ij
import com.maddyhome.idea.vim.undo.UndoRedoBase
@ -40,12 +38,7 @@ internal class UndoRedoHelper : UndoRedoBase() {
val scrollingModel = editor.getScrollingModel()
scrollingModel.accumulateViewportChanges()
// [VERSION UPDATE] 241+ remove this if
if (ApplicationInfo.getInstance().build.baselineVersion >= 241) {
undoFor241plus(editor, undoManager, fileEditor)
} else {
undoForLessThan241(undoManager, fileEditor, editor)
}
performUndo(editor, undoManager, fileEditor)
scrollingModel.flushViewportChanges()
@ -54,32 +47,7 @@ internal class UndoRedoHelper : UndoRedoBase() {
return false
}
private fun undoForLessThan241(
undoManager: UndoManager,
fileEditor: TextEditor,
editor: VimEditor,
) {
if (injector.globalIjOptions().oldundo) {
SelectionVimListenerSuppressor.lock().use { undoManager.undo(fileEditor) }
} else {
// TODO refactor me after VIM-308 when restoring selection and caret movement will be ignored by undo
editor.runWithChangeTracking {
undoManager.undo(fileEditor)
// We execute undo one more time if the previous one just restored selection
if (!hasChanges && hasSelection(editor) && undoManager.isUndoAvailable(fileEditor)) {
undoManager.undo(fileEditor)
}
}
CommandProcessor.getInstance().runUndoTransparentAction {
removeSelections(editor)
}
}
}
private fun undoFor241plus(
private fun performUndo(
editor: VimEditor,
undoManager: UndoManager,
fileEditor: TextEditor,
@ -119,47 +87,14 @@ internal class UndoRedoHelper : UndoRedoBase() {
val fileEditor = TextEditorProvider.getInstance().getTextEditor(editor.ij)
val undoManager = UndoManager.getInstance(project)
if (undoManager.isRedoAvailable(fileEditor)) {
// [VERSION UPDATE] 241+ remove this if
if (ApplicationInfo.getInstance().build.baselineVersion >= 241) {
redoFor241Plus(undoManager, fileEditor, editor)
} else {
redoForLessThan241(undoManager, fileEditor, editor)
}
performRedo(undoManager, fileEditor, editor)
return true
}
return false
}
private fun redoForLessThan241(
undoManager: UndoManager,
fileEditor: TextEditor,
editor: VimEditor,
) {
if (injector.globalIjOptions().oldundo) {
SelectionVimListenerSuppressor.lock().use { undoManager.redo(fileEditor) }
} else {
undoManager.redo(fileEditor)
CommandProcessor.getInstance().runUndoTransparentAction {
editor.carets().forEach { it.ij.removeSelection() }
}
// TODO refactor me after VIM-308 when restoring selection and caret movement will be ignored by undo
editor.runWithChangeTracking {
undoManager.redo(fileEditor)
// We execute undo one more time if the previous one just restored selection
if (!hasChanges && hasSelection(editor) && undoManager.isRedoAvailable(fileEditor)) {
undoManager.redo(fileEditor)
}
}
CommandProcessor.getInstance().runUndoTransparentAction {
removeSelections(editor)
}
}
}
private fun redoFor241Plus(
private fun performRedo(
undoManager: UndoManager,
fileEditor: TextEditor,
editor: VimEditor,

View File

@ -27,7 +27,7 @@
<!-- Please search for "[VERSION UPDATE]" in project in case you update the since-build version -->
<!-- Check for [Version Update] tag in YouTrack as well -->
<!-- Also, please update the value in build.gradle.kts file-->
<idea-version since-build="233.11799.241"/>
<idea-version since-build="241.15989.150"/>
<!-- Mark the plugin as compatible with RubyMine and other products based on the IntelliJ platform (including CWM) -->
<depends>com.intellij.modules.platform</depends>