Skip to content

Commit d90202f

Browse files
author
Maxime Labelle
committed
Fix - Make sure position is never negative.
1 parent 04e5335 commit d90202f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PSReadLine/ViRegister.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public int PasteBefore(StringBuilder buffer, int position)
168168

169169
// we adjust the current position to prevent a crash
170170

171-
position = Math.Min(position, buffer.Length - 1);
171+
position = Math.Max(0, Math.Min(position, buffer.Length - 1));
172172

173173
var text = _text;
174174

0 commit comments

Comments
 (0)