From 9bc2a6502aaf31c7a27b6ec11fc0fb1c652d6bf9 Mon Sep 17 00:00:00 2001 From: Carl Morris Date: Thu, 14 Nov 2019 12:42:23 -0600 Subject: [PATCH] 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. --- PSReadLine/BasicEditing.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PSReadLine/BasicEditing.cs b/PSReadLine/BasicEditing.cs index a207c038..1e2332ba 100644 --- a/PSReadLine/BasicEditing.cs +++ b/PSReadLine/BasicEditing.cs @@ -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;