diff --git a/PSReadLine/BasicEditing.cs b/PSReadLine/BasicEditing.cs index c52f338..069c092 100644 --- a/PSReadLine/BasicEditing.cs +++ b/PSReadLine/BasicEditing.cs @@ -107,8 +107,7 @@ namespace Microsoft.PowerShell consoleBuffer[i+1].BackgroundColor = console.BackgroundColor; console.WriteBufferLines(consoleBuffer, ref _singleton._initialY); - var y = coordinates.Y + 1; - _singleton.PlaceCursor(0, ref y); + _singleton.PlaceCursor(0, coordinates.Y + 1); _singleton._buffer.Clear(); // Clear so we don't actually run the input _singleton._current = 0; // If Render is called, _current must be correct. _singleton._currentHistoryIndex = _singleton._history.Count; @@ -293,8 +292,7 @@ namespace Microsoft.PowerShell } var coordinates = ConvertOffsetToCoordinates(_current); - var y = coordinates.Y + 1; - PlaceCursor(0, ref y); + PlaceCursor(0, coordinates.Y + 1); _inputAccepted = true; return true; } diff --git a/PSReadLine/KeyBindings.cs b/PSReadLine/KeyBindings.cs index 59a6ad3..332e15b 100644 --- a/PSReadLine/KeyBindings.cs +++ b/PSReadLine/KeyBindings.cs @@ -314,8 +314,7 @@ namespace Microsoft.PowerShell // Don't overwrite any of the line - so move to first line after the end of our buffer. var coords = _singleton.ConvertOffsetToCoordinates(_singleton._buffer.Length); - var y = coords.Y + 1; - _singleton.PlaceCursor(0, ref y); + _singleton.PlaceCursor(0, coords.Y + 1); console.WriteLine(buffer.ToString()); _singleton._initialY = console.CursorTop; @@ -373,8 +372,7 @@ namespace Microsoft.PowerShell // Don't overwrite any of the line - so move to first line after the end of our buffer. var coords = _singleton.ConvertOffsetToCoordinates(_singleton._buffer.Length); - var y = coords.Y + 1; - _singleton.PlaceCursor(0, ref y); + _singleton.PlaceCursor(0, coords.Y + 1); _singleton._console.WriteLine(buffer.ToString()); _singleton._initialY = _singleton._console.CursorTop; diff --git a/PSReadLine/Render.cs b/PSReadLine/Render.cs index 7b6a218..2288f15 100644 --- a/PSReadLine/Render.cs +++ b/PSReadLine/Render.cs @@ -470,7 +470,7 @@ namespace Microsoft.PowerShell charInfo.BackgroundColor = backgroundColor; } - private void PlaceCursor(int x, ref int y) + private void PlaceCursor(int x, int y) { int statusLineCount = GetStatusLineCount(); if ((y + statusLineCount) >= _console.BufferHeight) @@ -484,8 +484,7 @@ namespace Microsoft.PowerShell private void PlaceCursor() { var coordinates = ConvertOffsetToCoordinates(_current); - int y = coordinates.Y; - PlaceCursor(coordinates.X, ref y); + PlaceCursor(coordinates.X, coordinates.Y); } private COORD ConvertOffsetToCoordinates(int offset)