mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-03-05 15:32:51 +01:00
Change behaviour when inserting previously inserted text
This commit is contained in:
parent
04db2764c1
commit
def6d2bd5b
@ -329,12 +329,13 @@ public class ChangeGroup {
|
||||
processEscape(editor, context);
|
||||
}
|
||||
}
|
||||
//TODO: insert like in vim or not?
|
||||
|
||||
private String getInsertedText() {
|
||||
final StringBuilder multiCaret = new StringBuilder();
|
||||
final StringBuilder singleCaret = new StringBuilder();
|
||||
|
||||
boolean isMultiCaretInsertion = false;
|
||||
boolean isSingleCaretInsertion = false;
|
||||
|
||||
char[] lastInserted = {};
|
||||
MotionEditorAction lastMotion = null;
|
||||
@ -344,7 +345,7 @@ public class ChangeGroup {
|
||||
final char[] inserted = (char[]) lastStroke;
|
||||
|
||||
if (inserted.length > 1) {
|
||||
return new String(inserted);
|
||||
isSingleCaretInsertion = true;
|
||||
}
|
||||
|
||||
singleCaret.append(inserted);
|
||||
@ -360,6 +361,9 @@ public class ChangeGroup {
|
||||
}
|
||||
}
|
||||
|
||||
if (isSingleCaretInsertion) {
|
||||
return singleCaret.toString();
|
||||
}
|
||||
if (isMultiCaretInsertion) {
|
||||
return multiCaret.toString();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user