Remove unnecessary ref on parameter to PlaceCursor

This commit is contained in:
Jason Shirk
2017-07-31 15:55:29 -07:00
parent 6c7c3fd026
commit b823045bb2
3 changed files with 6 additions and 11 deletions
+2 -4
View File
@@ -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;
}
+2 -4
View File
@@ -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;
+2 -3
View File
@@ -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)