-
Notifications
You must be signed in to change notification settings - Fork 757
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix(VIM-3190): Do not use octopus handler if the enter key is used wi…
…th modifiers like shift or control
- Loading branch information
Showing
6 changed files
with
206 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
src/test/java/org/jetbrains/plugins/ideavim/action/EscapeTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* | ||
* Copyright 2003-2023 The IdeaVim authors | ||
* | ||
* Use of this source code is governed by an MIT-style | ||
* license that can be found in the LICENSE.txt file or at | ||
* https://opensource.org/licenses/MIT. | ||
*/ | ||
|
||
package org.jetbrains.plugins.ideavim.action | ||
|
||
import com.intellij.idea.TestFor | ||
import org.jetbrains.plugins.ideavim.VimTestCase | ||
import org.junit.jupiter.api.Test | ||
|
||
class EscapeTest : VimTestCase() { | ||
@Test | ||
@TestFor(issues = ["VIM-3190"]) | ||
fun `mapping to control esc`() { | ||
configureByText( | ||
""" | ||
Lorem Ipsum | ||
Lorem ipsum dolor sit amet,$c consectetur adipiscing elit | ||
Sed in orci mauris. | ||
Cras id tellus in ex imperdiet egestas. | ||
""".trimIndent() | ||
) | ||
|
||
typeText(commandToKeys("nmap <C-Esc> k")) | ||
typeText("<C-Esc>") | ||
|
||
assertState( | ||
""" | ||
Lorem Ipsum | ||
$c | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit | ||
Sed in orci mauris. | ||
Cras id tellus in ex imperdiet egestas. | ||
""".trimIndent() | ||
) | ||
} | ||
|
||
@Test | ||
@TestFor(issues = ["VIM-3190"]) | ||
fun `mapping to alt esc`() { | ||
configureByText( | ||
""" | ||
Lorem Ipsum | ||
Lorem ipsum dolor sit amet,$c consectetur adipiscing elit | ||
Sed in orci mauris. | ||
Cras id tellus in ex imperdiet egestas. | ||
""".trimIndent() | ||
) | ||
|
||
typeText(commandToKeys("nmap <A-Esc> k")) | ||
typeText("<A-Esc>") | ||
|
||
assertState( | ||
""" | ||
Lorem Ipsum | ||
$c | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit | ||
Sed in orci mauris. | ||
Cras id tellus in ex imperdiet egestas. | ||
""".trimIndent() | ||
) | ||
} | ||
|
||
@Test | ||
@TestFor(issues = ["VIM-3190"]) | ||
fun `mapping to shift esc`() { | ||
configureByText( | ||
""" | ||
Lorem Ipsum | ||
Lorem ipsum dolor sit amet,$c consectetur adipiscing elit | ||
Sed in orci mauris. | ||
Cras id tellus in ex imperdiet egestas. | ||
""".trimIndent() | ||
) | ||
|
||
typeText(commandToKeys("nmap <S-Esc> k")) | ||
typeText("<S-Esc>") | ||
|
||
assertState( | ||
""" | ||
Lorem Ipsum | ||
$c | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit | ||
Sed in orci mauris. | ||
Cras id tellus in ex imperdiet egestas. | ||
""".trimIndent() | ||
) | ||
} | ||
} |
96 changes: 96 additions & 0 deletions
96
src/test/java/org/jetbrains/plugins/ideavim/action/motion/updown/EnterNormalActionTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* | ||
* Copyright 2003-2023 The IdeaVim authors | ||
* | ||
* Use of this source code is governed by an MIT-style | ||
* license that can be found in the LICENSE.txt file or at | ||
* https://opensource.org/licenses/MIT. | ||
*/ | ||
|
||
package org.jetbrains.plugins.ideavim.action.motion.updown | ||
|
||
import com.intellij.idea.TestFor | ||
import org.jetbrains.plugins.ideavim.VimTestCase | ||
import org.junit.jupiter.api.Test | ||
|
||
class EnterNormalActionTest : VimTestCase() { | ||
@Test | ||
@TestFor(issues = ["VIM-3190"]) | ||
fun `mapping to control enter`() { | ||
configureByText( | ||
""" | ||
Lorem Ipsum | ||
Lorem ipsum dolor sit amet,$c consectetur adipiscing elit | ||
Sed in orci mauris. | ||
Cras id tellus in ex imperdiet egestas. | ||
""".trimIndent() | ||
) | ||
|
||
typeText(commandToKeys("nmap <C-Enter> k")) | ||
typeText("<C-Enter>") | ||
|
||
assertState( | ||
""" | ||
Lorem Ipsum | ||
$c | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit | ||
Sed in orci mauris. | ||
Cras id tellus in ex imperdiet egestas. | ||
""".trimIndent() | ||
) | ||
} | ||
|
||
@Test | ||
@TestFor(issues = ["VIM-3190"]) | ||
fun `mapping to alt enter`() { | ||
configureByText( | ||
""" | ||
Lorem Ipsum | ||
Lorem ipsum dolor sit amet,$c consectetur adipiscing elit | ||
Sed in orci mauris. | ||
Cras id tellus in ex imperdiet egestas. | ||
""".trimIndent() | ||
) | ||
|
||
typeText(commandToKeys("nmap <A-Enter> k")) | ||
typeText("<A-Enter>") | ||
|
||
assertState( | ||
""" | ||
Lorem Ipsum | ||
$c | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit | ||
Sed in orci mauris. | ||
Cras id tellus in ex imperdiet egestas. | ||
""".trimIndent() | ||
) | ||
} | ||
|
||
@Test | ||
@TestFor(issues = ["VIM-3190"]) | ||
fun `mapping to shift enter`() { | ||
configureByText( | ||
""" | ||
Lorem Ipsum | ||
Lorem ipsum dolor sit amet,$c consectetur adipiscing elit | ||
Sed in orci mauris. | ||
Cras id tellus in ex imperdiet egestas. | ||
""".trimIndent() | ||
) | ||
|
||
typeText(commandToKeys("nmap <S-Enter> k")) | ||
typeText("<S-Enter>") | ||
|
||
assertState( | ||
""" | ||
Lorem Ipsum | ||
$c | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit | ||
Sed in orci mauris. | ||
Cras id tellus in ex imperdiet egestas. | ||
""".trimIndent() | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters