Skip to content

Commit

Permalink
Set cursor via the public API SetCursorPosition in AcceptLineImpl
Browse files Browse the repository at this point in the history
… for better buffer check (#1182)

Instead of _console.SetCursorPosition(), use public API SetCursorPosition so that existing end of buffer checks can be performed.
  • Loading branch information
msftrncs authored and daxian-dbw committed Nov 14, 2019
1 parent 9644382 commit 9bc2a65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PSReadLine/BasicEditing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ private bool AcceptLineImpl(bool validate)
ClearStatusMessage(render: true);
}

var point = ConvertOffsetToPoint(_current);
_console.SetCursorPosition(point.X, point.Y);
// Let public API set cursor to end of line incase end of line is end of buffer
SetCursorPosition(_current);
_console.Write("\n");
_inputAccepted = true;
return true;
Expand Down

0 comments on commit 9bc2a65

Please sign in to comment.