1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-05-30 13:34:08 +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> </option>
</component> </component>
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" /> <mapping directory="" vcs="Git" />
</component> </component>
</project> </project>

View File

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

View File

@ -310,7 +310,7 @@ tasks {
patchPluginXml { patchPluginXml {
// Don't forget to update plugin.xml // Don't forget to update plugin.xml
sinceBuild.set("233.11799.241") sinceBuild.set("241.15989.150")
changeNotes.set( changeNotes.set(
"""<a href="https://youtrack.jetbrains.com/issues/VIM?q=State:%20Fixed%20Fix%20versions:%20${version.get()}">Changelog</a>""" """<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 # suppress inspection "UnusedProperty" for whole file
#ideaVersion=LATEST-EAP-SNAPSHOT #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 # Values for type: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#intellij-extension-type
ideaType=IC ideaType=IC
downloadIdeaSources=true 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.DataContext
import com.intellij.openapi.actionSystem.PlatformDataKeys import com.intellij.openapi.actionSystem.PlatformDataKeys
import com.intellij.openapi.application.ApplicationInfo
import com.intellij.openapi.command.CommandProcessor import com.intellij.openapi.command.CommandProcessor
import com.intellij.openapi.command.undo.UndoManager import com.intellij.openapi.command.undo.UndoManager
import com.intellij.openapi.components.Service 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.VimEditor
import com.maddyhome.idea.vim.api.injector import com.maddyhome.idea.vim.api.injector
import com.maddyhome.idea.vim.common.ChangesListener 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.globalIjOptions
import com.maddyhome.idea.vim.newapi.ij import com.maddyhome.idea.vim.newapi.ij
import com.maddyhome.idea.vim.undo.UndoRedoBase import com.maddyhome.idea.vim.undo.UndoRedoBase
@ -40,12 +38,7 @@ internal class UndoRedoHelper : UndoRedoBase() {
val scrollingModel = editor.getScrollingModel() val scrollingModel = editor.getScrollingModel()
scrollingModel.accumulateViewportChanges() scrollingModel.accumulateViewportChanges()
// [VERSION UPDATE] 241+ remove this if performUndo(editor, undoManager, fileEditor)
if (ApplicationInfo.getInstance().build.baselineVersion >= 241) {
undoFor241plus(editor, undoManager, fileEditor)
} else {
undoForLessThan241(undoManager, fileEditor, editor)
}
scrollingModel.flushViewportChanges() scrollingModel.flushViewportChanges()
@ -54,32 +47,7 @@ internal class UndoRedoHelper : UndoRedoBase() {
return false return false
} }
private fun undoForLessThan241( private fun performUndo(
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(
editor: VimEditor, editor: VimEditor,
undoManager: UndoManager, undoManager: UndoManager,
fileEditor: TextEditor, fileEditor: TextEditor,
@ -119,47 +87,14 @@ internal class UndoRedoHelper : UndoRedoBase() {
val fileEditor = TextEditorProvider.getInstance().getTextEditor(editor.ij) val fileEditor = TextEditorProvider.getInstance().getTextEditor(editor.ij)
val undoManager = UndoManager.getInstance(project) val undoManager = UndoManager.getInstance(project)
if (undoManager.isRedoAvailable(fileEditor)) { if (undoManager.isRedoAvailable(fileEditor)) {
// [VERSION UPDATE] 241+ remove this if performRedo(undoManager, fileEditor, editor)
if (ApplicationInfo.getInstance().build.baselineVersion >= 241) {
redoFor241Plus(undoManager, fileEditor, editor)
} else {
redoForLessThan241(undoManager, fileEditor, editor)
}
return true return true
} }
return false return false
} }
private fun redoForLessThan241( private fun performRedo(
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(
undoManager: UndoManager, undoManager: UndoManager,
fileEditor: TextEditor, fileEditor: TextEditor,
editor: VimEditor, editor: VimEditor,

View File

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