Skip to content

Commit bbbe43b

Browse files
authored
No list view prediction when the first line was scrolled up off the buffer (#3372)
1 parent e9d4242 commit bbbe43b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

PSReadLine/Prediction.Views.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,13 @@ internal PredictionListView(PSConsoleReadLine singleton)
275275

276276
internal override void GetSuggestion(string userInput)
277277
{
278+
if (_singleton._initialY < 0)
279+
{
280+
// Do not trigger list view prediction when the first line has already been scrolled up off the buffer.
281+
// See https://github.com/PowerShell/PSReadLine/issues/3347 for an example where this may happen.
282+
return;
283+
}
284+
278285
bool inputUnchanged = string.Equals(_inputText, userInput, _singleton._options.HistoryStringComparison);
279286
if (!inputUnchanged && _selectedIndex > -1)
280287
{

0 commit comments

Comments
 (0)