diff --git a/src/main/java/com/maddyhome/idea/vim/helper/UserDataManager.kt b/src/main/java/com/maddyhome/idea/vim/helper/UserDataManager.kt index 8aaf50caa..49e983c58 100644 --- a/src/main/java/com/maddyhome/idea/vim/helper/UserDataManager.kt +++ b/src/main/java/com/maddyhome/idea/vim/helper/UserDataManager.kt @@ -124,10 +124,6 @@ internal var Editor.vimMorePanel: ExOutputPanel? by userData() internal var Editor.vimExOutput: ExOutputModel? by userData() internal var Editor.vimTestInputModel: TestInputModel? by userData() -/** - * Checks whether a keeping visual mode visual operator action is performed on editor. - */ -internal var Editor.vimKeepingVisualOperatorAction: Boolean by userDataOr { false } internal var Editor.vimChangeActionSwitchMode: Mode? by userData() /** diff --git a/src/main/java/com/maddyhome/idea/vim/newapi/IjVimEditor.kt b/src/main/java/com/maddyhome/idea/vim/newapi/IjVimEditor.kt index e1fc2b503..e3a9ee2d7 100644 --- a/src/main/java/com/maddyhome/idea/vim/newapi/IjVimEditor.kt +++ b/src/main/java/com/maddyhome/idea/vim/newapi/IjVimEditor.kt @@ -54,7 +54,6 @@ import com.maddyhome.idea.vim.helper.isTemplateActive import com.maddyhome.idea.vim.helper.updateCaretsVisualAttributes import com.maddyhome.idea.vim.helper.updateCaretsVisualPosition import com.maddyhome.idea.vim.helper.vimChangeActionSwitchMode -import com.maddyhome.idea.vim.helper.vimKeepingVisualOperatorAction import com.maddyhome.idea.vim.helper.vimLastSelectionType import com.maddyhome.idea.vim.state.mode.Mode import com.maddyhome.idea.vim.state.mode.SelectionType @@ -67,7 +66,7 @@ internal class IjVimEditor(editor: Editor) : MutableLinearEditor() { companion object { // For cases where Editor does not have a project (for some reason) // It's something IJ Platform related and stored here because of this reason - const val DEFAULT_PROJECT_ID = "no project" + const val DEFAULT_PROJECT_ID = "no project" } // All the editor actions should be performed with top level editor!!! @@ -82,11 +81,6 @@ internal class IjVimEditor(editor: Editor) : MutableLinearEditor() { set(value) { editor.vimChangeActionSwitchMode = value } - override var vimKeepingVisualOperatorAction: Boolean - get() = editor.vimKeepingVisualOperatorAction - set(value) { - editor.vimKeepingVisualOperatorAction = value - } override fun fileSize(): Long = editor.fileSize.toLong() diff --git a/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/api/VimEditor.kt b/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/api/VimEditor.kt index 38a33e4fa..4038bb4d3 100644 --- a/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/api/VimEditor.kt +++ b/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/api/VimEditor.kt @@ -127,7 +127,6 @@ public interface VimEditor { public val lfMakesNewLine: Boolean public var vimChangeActionSwitchMode: Mode? - public var vimKeepingVisualOperatorAction: Boolean public fun fileSize(): Long @@ -242,7 +241,7 @@ public interface VimEditor { public fun getPath(): String? public fun extractProtocol(): String? - + // Can be used as a key to store something for specific project public val projectId: String diff --git a/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/handler/VisualOperatorActionHandler.kt b/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/handler/VisualOperatorActionHandler.kt index 4fbcf14e1..e1d7702e0 100644 --- a/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/handler/VisualOperatorActionHandler.kt +++ b/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/handler/VisualOperatorActionHandler.kt @@ -232,7 +232,6 @@ public sealed class VisualOperatorActionHandler : EditorActionHandlerBase(false) fun start() { logger.debug("Preparing visual command") - editor.vimKeepingVisualOperatorAction = false //CommandFlags.FLAG_EXIT_VISUAL !in cmd.flags editor.forEachCaret { val change = @@ -268,8 +267,6 @@ public sealed class VisualOperatorActionHandler : EditorActionHandlerBase(false) } } } - - editor.vimKeepingVisualOperatorAction = false } } diff --git a/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/helper/EngineModeExtensions.kt b/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/helper/EngineModeExtensions.kt index 425dde8be..8b0f609cb 100644 --- a/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/helper/EngineModeExtensions.kt +++ b/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/helper/EngineModeExtensions.kt @@ -27,9 +27,7 @@ public fun VimEditor.exitVisualMode() { if (inBlockSelection) { this.removeSecondaryCarets() } - if (!this.vimKeepingVisualOperatorAction) { - this.nativeCarets().forEach(VimCaret::removeSelection) - } + this.nativeCarets().forEach(VimCaret::removeSelection) } if (this.inVisualMode) { this.vimLastSelectionType = selectionType