mirror of
https://github.com/PowerShell/PSReadLine
synced 2026-06-08 12:12:13 +00:00
Remove unnecessary ref on parameter to PlaceCursor
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user