mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-07-27 02:59:01 +02:00
Remove resetState() from editor
It mostly resets KeyHandler, so it's more a KeyHandler responsibility. It also utilises deprecated API.
This commit is contained in:
parent
6cee04a4be
commit
453cca3b0c
vim-engine/src/main/kotlin/com/maddyhome/idea/vim
@ -296,7 +296,11 @@ public class KeyHandler {
|
||||
public fun fullReset(editor: VimEditor) {
|
||||
logger.trace { "Full reset" }
|
||||
injector.messages.clearError()
|
||||
editor.resetState()
|
||||
|
||||
editor.mode = Mode.NORMAL()
|
||||
editor.vimStateMachine.executingCommand = null
|
||||
keyHandlerState.digraphSequence.reset()
|
||||
|
||||
reset(keyHandlerState, editor.mode)
|
||||
injector.registerGroupIfCreated?.resetRegister()
|
||||
editor.removeSelection()
|
||||
|
@ -13,7 +13,6 @@ import com.maddyhome.idea.vim.common.LiveRange
|
||||
import com.maddyhome.idea.vim.common.TextRange
|
||||
import com.maddyhome.idea.vim.helper.vimStateMachine
|
||||
import com.maddyhome.idea.vim.impl.state.VimStateMachineImpl
|
||||
import com.maddyhome.idea.vim.impl.state.toMappingMode
|
||||
import com.maddyhome.idea.vim.state.mode.Mode
|
||||
import com.maddyhome.idea.vim.state.mode.ReturnTo
|
||||
import com.maddyhome.idea.vim.state.mode.SelectionType
|
||||
@ -294,18 +293,6 @@ public interface VimEditor {
|
||||
*/
|
||||
public fun <T : ImmutableVimCaret> findLastVersionOfCaret(caret: T): T?
|
||||
|
||||
/**
|
||||
* Resets the command, mode, visual mode, and mapping mode to initial values.
|
||||
*/
|
||||
public fun resetState() {
|
||||
mode = Mode.NORMAL()
|
||||
vimStateMachine.executingCommand = null
|
||||
vimStateMachine.digraphSequence.reset()
|
||||
vimStateMachine.commandBuilder.resetInProgressCommandPart(
|
||||
injector.keyGroup.getKeyRoot(mode.toMappingMode())
|
||||
)
|
||||
}
|
||||
|
||||
public fun resetOpPending() {
|
||||
if (this.mode is Mode.OP_PENDING) {
|
||||
val returnTo = this.mode.returnTo
|
||||
|
@ -17,7 +17,6 @@ import com.maddyhome.idea.vim.command.MappingState
|
||||
import com.maddyhome.idea.vim.common.DigraphResult
|
||||
import com.maddyhome.idea.vim.common.DigraphSequence
|
||||
import com.maddyhome.idea.vim.helper.noneOfEnum
|
||||
import com.maddyhome.idea.vim.state.KeyHandlerState
|
||||
import com.maddyhome.idea.vim.state.VimStateMachine
|
||||
import com.maddyhome.idea.vim.state.mode.Mode
|
||||
import org.jetbrains.annotations.Contract
|
||||
|
Loading…
Reference in New Issue
Block a user