mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-02-26 14:46:00 +01:00
Add UI test for multicaret enter
For ticket VIM-3186
This commit is contained in:
parent
4e43606932
commit
a2681ce6cc
src/test/java/ui
@ -90,6 +90,7 @@ class UiTests {
|
||||
testGutterClick(editor)
|
||||
testAddNewLineInNormalMode(editor)
|
||||
testMappingToCtrlOrAltEnter(editor)
|
||||
testMilticaretEnter(editor)
|
||||
reenableIdeaVim(editor)
|
||||
|
||||
createFile("MyTest.java", this@uiTest)
|
||||
@ -572,4 +573,43 @@ class UiTests {
|
||||
|
||||
vimExit()
|
||||
}
|
||||
|
||||
// For VIM-3186
|
||||
private fun ContainerFixture.testMilticaretEnter(editor: Editor) {
|
||||
println("Run testMilticaretEnter...")
|
||||
|
||||
keyboard {
|
||||
pressing(KeyEvent.VK_ALT) {
|
||||
pressing(KeyEvent.VK_SHIFT) {
|
||||
findText("One").click()
|
||||
findText("Three").click()
|
||||
findText("Five").click()
|
||||
}
|
||||
}
|
||||
|
||||
enterText("A")
|
||||
enter()
|
||||
}
|
||||
|
||||
assertEquals(3, editor.caretCount)
|
||||
|
||||
assertEquals("""
|
||||
|One Two
|
||||
|
|
||||
|Three Four
|
||||
|
|
||||
|Five
|
||||
|
|
||||
""".trimMargin(), editor.text)
|
||||
|
||||
// Reset state
|
||||
keyboard { escape() }
|
||||
assertEquals(1, editor.caretCount)
|
||||
resetPlainTest(editor)
|
||||
vimExit()
|
||||
}
|
||||
|
||||
private fun resetPlainTest(editor: Editor) {
|
||||
editor.injectText(testTextForEditor)
|
||||
}
|
||||
}
|
||||
|
@ -44,6 +44,9 @@ class Editor(
|
||||
val caretOffset: Int
|
||||
get() = callJs("component.getEditor().getCaretModel().getOffset()", runInEdt = true)
|
||||
|
||||
val caretCount: Int
|
||||
get() = callJs("component.getEditor().getCaretModel().getCaretCount()", runInEdt = true)
|
||||
|
||||
val isBlockCursor: Boolean
|
||||
// get() = callJs("component.getEditor().getSettings().isBlockCursor()", true)
|
||||
// Doesn't work at the moment because remote robot can't resolve classes from a plugin classloader
|
||||
|
Loading…
Reference in New Issue
Block a user