mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-02-25 02:46:01 +01:00
VIM-2099 Fix operations with backward inclusive motions
This commit is contained in:
parent
86d6876db4
commit
33f8a00679
@ -28,6 +28,7 @@ To Be Released
|
||||
**Fixes:**
|
||||
* [VIM-2097](https://youtrack.jetbrains.com/issue/VIM-2097) Do not apply mappings for register selecting
|
||||
* [VIM-2080](https://youtrack.jetbrains.com/issue/VIM-2080) Fix S command with count
|
||||
* [VIM-2099](https://youtrack.jetbrains.com/issue/VIM-2099) Fix operations with backward inclusive motions
|
||||
|
||||
0.59, 2020-08-25
|
||||
------------
|
||||
|
@ -112,7 +112,12 @@ public class MotionGroup {
|
||||
|
||||
// If inclusive, add the last character to the range
|
||||
if (action.getMotionType() == MotionType.INCLUSIVE && end < EditorHelperRt.getFileSize(editor)) {
|
||||
end++;
|
||||
if (start > end) {
|
||||
start ++;
|
||||
}
|
||||
else {
|
||||
end++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (cmd.getAction() instanceof TextObjectActionHandler) {
|
||||
|
@ -193,4 +193,12 @@ class MotionPercentOrMatchActionTest : VimTestCase() {
|
||||
doTest("%", """ "I found ${c}it in \\\"a (legendary) land" """,
|
||||
""" "I found it in \\\"a (legendary${c}) land" """, CommandState.Mode.COMMAND, CommandState.SubMode.NONE)
|
||||
}
|
||||
|
||||
fun `test deleting with percent motion backward`() {
|
||||
doTest("d%", "(foo bar$c)", c, CommandState.Mode.COMMAND, CommandState.SubMode.NONE)
|
||||
}
|
||||
|
||||
fun `test deleting with percent motion`() {
|
||||
doTest("d%", "$c(foo bar)", c, CommandState.Mode.COMMAND, CommandState.SubMode.NONE)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user