1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-09-12 07:53:08 +02:00

Fix recursive runForEachCaret and a missing read action

This commit is contained in:
Alex Plate
2025-03-07 17:41:13 +02:00
parent e899a99313
commit 09321f409c
2 changed files with 11 additions and 1 deletions
src
main
java
com
maddyhome
idea
test
java
org
jetbrains
plugins
ideavim

@@ -542,7 +542,9 @@ internal class InsertTimeRecorder : ModeChangeListener {
if (oldMode == Mode.INSERT) {
val undo = injector.undo as? VimTimestampBasedUndoService ?: return
val nanoTime = System.nanoTime()
editor.forEachCaret { undo.endInsertSequence(it, it.offset, nanoTime) }
injector.application.runReadAction {
editor.nativeCarets().forEach { undo.endInsertSequence(it, it.offset, nanoTime) }
}
}
}
}

@@ -1081,4 +1081,12 @@ foobaz
typeText("<BS><BS><BS>")
assertState("1ello world")
}
@Test
fun `backspace with replace modes`() {
configureByText("")
typeText("c<C-Home><Esc>.")
assertState("")
assertPluginError(false)
}
}