mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-05-06 03:34:03 +02:00
VIM-404 Fixed 'O' at the first line
This commit is contained in:
parent
befcf4298f
commit
ca8026f612
@ -65,6 +65,8 @@ tag char note action in Normal mode ~
|
||||
|count| 9 "
|
||||
|F| F{char} 1 cursor to the Nth occurrence of {char} to
|
||||
the left
|
||||
|O| O 2 begin a new line above the cursor and
|
||||
insert text, repeat N times
|
||||
|P| ["x]P 2 put the text [from buffer x] before the
|
||||
cursor N times
|
||||
|T| T{char} 1 cursor till after Nth occurrence of {char}
|
||||
|
@ -171,9 +171,7 @@ public class ChangeGroup extends AbstractActionGroup {
|
||||
if (state.getMode() != CommandState.Mode.REPEAT) {
|
||||
KeyHandler.executeAction("VimEditorEnter", context);
|
||||
}
|
||||
else {
|
||||
MotionGroup.moveCaret(editor, CommandGroups.getInstance().getMotion().moveCaretVertical(editor, -1));
|
||||
}
|
||||
MotionGroup.moveCaret(editor, CommandGroups.getInstance().getMotion().moveCaretVertical(editor, -1));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -240,6 +240,13 @@ public class ChangeActionTest extends VimTestCase {
|
||||
"fo<caret>\n");
|
||||
}
|
||||
|
||||
// VIM-404 |O|
|
||||
public void testInsertNewLineAboveFirstLine() {
|
||||
doTest(stringToKeys("Obar"),
|
||||
"fo<caret>o\n",
|
||||
"bar\nfoo\n");
|
||||
}
|
||||
|
||||
private void doTest(final List<KeyStroke> keys, String before, String after) {
|
||||
myFixture.configureByText("a.java", before);
|
||||
final Editor editor = myFixture.getEditor();
|
||||
|
Loading…
Reference in New Issue
Block a user