mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-06-17 06:40:00 +02:00
Remove unnecessary keeping visual mode flag
The value was only ever set to false.
This commit is contained in:
parent
4f407ccc03
commit
8ab43e98fe
src/main/java/com/maddyhome/idea/vim
vim-engine/src/main/kotlin/com/maddyhome/idea/vim
@ -124,10 +124,6 @@ internal var Editor.vimMorePanel: ExOutputPanel? by userData()
|
|||||||
internal var Editor.vimExOutput: ExOutputModel? by userData()
|
internal var Editor.vimExOutput: ExOutputModel? by userData()
|
||||||
internal var Editor.vimTestInputModel: TestInputModel? 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()
|
internal var Editor.vimChangeActionSwitchMode: Mode? by userData()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,7 +54,6 @@ import com.maddyhome.idea.vim.helper.isTemplateActive
|
|||||||
import com.maddyhome.idea.vim.helper.updateCaretsVisualAttributes
|
import com.maddyhome.idea.vim.helper.updateCaretsVisualAttributes
|
||||||
import com.maddyhome.idea.vim.helper.updateCaretsVisualPosition
|
import com.maddyhome.idea.vim.helper.updateCaretsVisualPosition
|
||||||
import com.maddyhome.idea.vim.helper.vimChangeActionSwitchMode
|
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.helper.vimLastSelectionType
|
||||||
import com.maddyhome.idea.vim.state.mode.Mode
|
import com.maddyhome.idea.vim.state.mode.Mode
|
||||||
import com.maddyhome.idea.vim.state.mode.SelectionType
|
import com.maddyhome.idea.vim.state.mode.SelectionType
|
||||||
@ -67,7 +66,7 @@ internal class IjVimEditor(editor: Editor) : MutableLinearEditor() {
|
|||||||
companion object {
|
companion object {
|
||||||
// For cases where Editor does not have a project (for some reason)
|
// 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
|
// 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!!!
|
// All the editor actions should be performed with top level editor!!!
|
||||||
@ -82,11 +81,6 @@ internal class IjVimEditor(editor: Editor) : MutableLinearEditor() {
|
|||||||
set(value) {
|
set(value) {
|
||||||
editor.vimChangeActionSwitchMode = value
|
editor.vimChangeActionSwitchMode = value
|
||||||
}
|
}
|
||||||
override var vimKeepingVisualOperatorAction: Boolean
|
|
||||||
get() = editor.vimKeepingVisualOperatorAction
|
|
||||||
set(value) {
|
|
||||||
editor.vimKeepingVisualOperatorAction = value
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun fileSize(): Long = editor.fileSize.toLong()
|
override fun fileSize(): Long = editor.fileSize.toLong()
|
||||||
|
|
||||||
|
@ -127,7 +127,6 @@ public interface VimEditor {
|
|||||||
|
|
||||||
public val lfMakesNewLine: Boolean
|
public val lfMakesNewLine: Boolean
|
||||||
public var vimChangeActionSwitchMode: Mode?
|
public var vimChangeActionSwitchMode: Mode?
|
||||||
public var vimKeepingVisualOperatorAction: Boolean
|
|
||||||
|
|
||||||
public fun fileSize(): Long
|
public fun fileSize(): Long
|
||||||
|
|
||||||
@ -242,7 +241,7 @@ public interface VimEditor {
|
|||||||
|
|
||||||
public fun getPath(): String?
|
public fun getPath(): String?
|
||||||
public fun extractProtocol(): String?
|
public fun extractProtocol(): String?
|
||||||
|
|
||||||
// Can be used as a key to store something for specific project
|
// Can be used as a key to store something for specific project
|
||||||
public val projectId: String
|
public val projectId: String
|
||||||
|
|
||||||
|
@ -232,7 +232,6 @@ public sealed class VisualOperatorActionHandler : EditorActionHandlerBase(false)
|
|||||||
|
|
||||||
fun start() {
|
fun start() {
|
||||||
logger.debug("Preparing visual command")
|
logger.debug("Preparing visual command")
|
||||||
editor.vimKeepingVisualOperatorAction = false //CommandFlags.FLAG_EXIT_VISUAL !in cmd.flags
|
|
||||||
|
|
||||||
editor.forEachCaret {
|
editor.forEachCaret {
|
||||||
val change =
|
val change =
|
||||||
@ -268,8 +267,6 @@ public sealed class VisualOperatorActionHandler : EditorActionHandlerBase(false)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.vimKeepingVisualOperatorAction = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,9 +27,7 @@ public fun VimEditor.exitVisualMode() {
|
|||||||
if (inBlockSelection) {
|
if (inBlockSelection) {
|
||||||
this.removeSecondaryCarets()
|
this.removeSecondaryCarets()
|
||||||
}
|
}
|
||||||
if (!this.vimKeepingVisualOperatorAction) {
|
this.nativeCarets().forEach(VimCaret::removeSelection)
|
||||||
this.nativeCarets().forEach(VimCaret::removeSelection)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (this.inVisualMode) {
|
if (this.inVisualMode) {
|
||||||
this.vimLastSelectionType = selectionType
|
this.vimLastSelectionType = selectionType
|
||||||
|
Loading…
Reference in New Issue
Block a user