1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-03-06 00:32:52 +01:00

Fixed bug with put blockwise text. Properly this time

This commit is contained in:
Vitalii Karavaev 2018-07-19 18:00:14 +03:00
parent d05c7268d9
commit 0773c886ee
2 changed files with 5 additions and 7 deletions
src/com/maddyhome/idea/vim/group
test/org/jetbrains/plugins/ideavim/action

View File

@ -307,11 +307,9 @@ public class CopyGroup {
final int lineCount = StringUtil.getLineBreakCount(text) + 1;
if (currentLine + lineCount >= EditorHelper.getLineCount(editor)) {
//There was a bug in original VimPlugin. Insufficient amount of blank lines was inserted
//TODO: add bugfix in and pr
final int limit = currentLine + lineCount - EditorHelper.getLineCount(editor);
for (int i = 0; i < limit; i++) {
VimPlugin.getChange().insertText(editor, EditorHelper.getFileSize(editor, true), "\n");
for (int i = 0; i < currentLine + lineCount - EditorHelper.getLineCount(editor); i++) {
MotionGroup.moveCaret(editor, caret, EditorHelper.getFileSize(editor, true));
VimPlugin.getChange().insertText(editor, caret, "\n");
}
}

View File

@ -1834,7 +1834,7 @@ public class MultipleCaretsTest extends VimTestCase {
}
public void testYankMotion() {
final String before = "qwe <caret>asd <caret>zxc\nqwe";
final String before = "qwe <caret>asd <caret>zxc";
configureByText(before);
typeText(parseKeys("ye"));
@ -1845,7 +1845,7 @@ public class MultipleCaretsTest extends VimTestCase {
typeText(parseKeys("P"));
final String after = "qwe <caret>asdasd <caret>asdzxc\n" +
"qwe zxc zxc";
" zxc zxc";
myFixture.checkResult(after);
}