Skip to content

Commit

Permalink
Fix(VIM-3802): Completion should create undo checkpoint
Browse files Browse the repository at this point in the history
Do not create checkpoints for Enter keypress
  • Loading branch information
lippfi committed Feb 25, 2025
1 parent f6146b8 commit 75dadc9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) }
Expand Down

0 comments on commit 75dadc9

Please sign in to comment.