Skip to content

Commit 979a2c3

Browse files
committed
Fixing defect #263.
1 parent c4c396e commit 979a2c3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

PSReadLine/Replace.vi.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private static void ViReplaceToEnd(ConsoleKeyInfo? key, object arg)
129129
{
130130
_singleton._groupUndoHelper.StartGroup(ViReplaceToEnd, arg);
131131
DeleteToEnd(key, arg);
132-
_singleton._current++;
132+
_singleton._current = Math.Min(_singleton._buffer.Length, _singleton._current + 1);
133133
_singleton.PlaceCursor();
134134
ViInsertMode(key, arg);
135135
}

UnitTestPSReadLine/BasicEditingTest.VI.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ public void ViTestChangeMovement()
8383
"lrylre", CheckThat(() => AssertLineIs("gOOD123ye")),
8484
"hR45", _.Escape, CheckThat(() => AssertLineIs("gOOD12345"))
8585
));
86+
87+
Test("hello", Keys(
88+
_.Escape, "Chello", _.Escape, CheckThat(() => AssertLineIs("hello")),
89+
"0Cgoodbye", _.Escape, CheckThat(() => AssertLineIs("goodbye")),
90+
'u'
91+
));
8692
}
8793

8894
[TestMethod]

0 commit comments

Comments
 (0)