1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-05-03 22:34:03 +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
No known key found for this signature in database
GPG Key ID: 0B97153C8FFEC09F
2 changed files with 11 additions and 1 deletions
src
main/java/com/maddyhome/idea/vim/newapi
test/java/org/jetbrains/plugins/ideavim/action

View File

@ -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) }
}
}
}
}

View File

@ -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)
}
}