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

Fix(VIM-3802): Completion should create undo checkpoint

Do not create checkpoints for Enter keypress
This commit is contained in:
Filipp Vakhitov 2025-02-25 15:09:41 +02:00
parent f6146b8732
commit 75dadc9610

View File

@ -28,6 +28,7 @@ import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.openapi.actionSystem.ex.AnActionListener
import com.intellij.openapi.actionSystem.impl.ProxyShortcutSet
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.editor.actions.EnterAction
import com.intellij.openapi.keymap.KeymapManager
import com.intellij.openapi.project.DumbAwareToggleAction
import com.intellij.openapi.util.TextRange
@ -71,7 +72,7 @@ internal object IdeaSpecifics {
}
val isVimAction = (action as? AnActionWrapper)?.delegate is VimShortcutKeyAction
if (!isVimAction && injector.vimState.mode == Mode.INSERT) {
if (!isVimAction && injector.vimState.mode == Mode.INSERT && action !is EnterAction) {
val undoService = injector.undo as VimTimestampBasedUndoService
val nanoTime = System.nanoTime()
editor?.vim?.forEachCaret { undoService.endInsertSequence(it, it.offset, nanoTime) }