From 96e69092bd7135986f124db08354d85c31600a38 Mon Sep 17 00:00:00 2001 From: msftrncs Date: Wed, 13 Nov 2019 21:12:39 -0600 Subject: [PATCH] Do not directly set cursor on AcceptLineImpl Instead of _console.SetCursorPosition(), use public API SetCursorPosition so that existing end of buffer checks can be performed. Fixes #1181 --- 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;