Skip to content

Commit 9bc2a65

Browse files
msftrncsdaxian-dbw
authored andcommitted
Set cursor via the public API SetCursorPosition in AcceptLineImpl for better buffer check (#1182)
Instead of _console.SetCursorPosition(), use public API SetCursorPosition so that existing end of buffer checks can be performed.
1 parent 9644382 commit 9bc2a65

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

PSReadLine/BasicEditing.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ private bool AcceptLineImpl(bool validate)
272272
ClearStatusMessage(render: true);
273273
}
274274

275-
var point = ConvertOffsetToPoint(_current);
276-
_console.SetCursorPosition(point.X, point.Y);
275+
// Let public API set cursor to end of line incase end of line is end of buffer
276+
SetCursorPosition(_current);
277277
_console.Write("\n");
278278
_inputAccepted = true;
279279
return true;

0 commit comments

Comments
 (0)