mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-06-06 07:34:04 +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 "
|
|count| 9 "
|
||||||
|F| F{char} 1 cursor to the Nth occurrence of {char} to
|
|F| F{char} 1 cursor to the Nth occurrence of {char} to
|
||||||
the left
|
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
|
|P| ["x]P 2 put the text [from buffer x] before the
|
||||||
cursor N times
|
cursor N times
|
||||||
|T| T{char} 1 cursor till after Nth occurrence of {char}
|
|T| T{char} 1 cursor till after Nth occurrence of {char}
|
||||||
|
@ -171,11 +171,9 @@ public class ChangeGroup extends AbstractActionGroup {
|
|||||||
if (state.getMode() != CommandState.Mode.REPEAT) {
|
if (state.getMode() != CommandState.Mode.REPEAT) {
|
||||||
KeyHandler.executeAction("VimEditorEnter", context);
|
KeyHandler.executeAction("VimEditorEnter", context);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
MotionGroup.moveCaret(editor, CommandGroups.getInstance().getMotion().moveCaretVertical(editor, -1));
|
MotionGroup.moveCaret(editor, CommandGroups.getInstance().getMotion().moveCaretVertical(editor, -1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
MotionGroup.moveCaret(editor, CommandGroups.getInstance().getMotion().moveCaretVertical(editor, -1));
|
MotionGroup.moveCaret(editor, CommandGroups.getInstance().getMotion().moveCaretVertical(editor, -1));
|
||||||
insertNewLineBelow(editor, context);
|
insertNewLineBelow(editor, context);
|
||||||
|
@ -240,6 +240,13 @@ public class ChangeActionTest extends VimTestCase {
|
|||||||
"fo<caret>\n");
|
"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) {
|
private void doTest(final List<KeyStroke> keys, String before, String after) {
|
||||||
myFixture.configureByText("a.java", before);
|
myFixture.configureByText("a.java", before);
|
||||||
final Editor editor = myFixture.getEditor();
|
final Editor editor = myFixture.getEditor();
|
||||||
|
Loading…
Reference in New Issue
Block a user