Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 2 menu completion issues that happen when we need to scroll screen buffer #2949

Merged
merged 1 commit into from
Nov 4, 2021

Conversation

daxian-dbw
Copy link
Member

@daxian-dbw daxian-dbw commented Nov 4, 2021

PR Summary

Fix #2928
Fix #2948

The details of the issues and root cause can be found at #2928 (comment) and #2948 (comment)

Major changes in this PR:

  1. Handle moving the cursor to the start-drawing position appropriately, taking screen buffer scrolling in consideration.
  2. Move duplicate code into the function MoveCursorToStartDrawingPosition and used it for both menu completion and dynamic help.
  3. Initialize PreviousTop correctly before Top is changed, and get rid of bufferEndPoint.Y because we should compare Top with PreviousTop to determine if menu moved.

PR Checklist

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • Make sure you've added one or more new tests
    - Cannot add tests because we cannot mimic buffer scrolling with the testing console, but I manually validated the fix
  • Make sure you've tested these changes in terminals that PowerShell is commonly used in (i.e. conhost.exe, Windows Terminal, Visual Studio Code Integrated Terminal, etc.)
  • User-facing changes
    • Not Applicable
    • OR
    • Documentation needed at PowerShell-Docs
      • Doc Issue filed:
Microsoft Reviewers: Open in CodeFlow

@daxian-dbw
Copy link
Member Author

@andschwa Can you please do a sanity check for me? Thanks!

@daxian-dbw daxian-dbw merged commit 81bf866 into PowerShell:master Nov 4, 2021
@daxian-dbw daxian-dbw deleted the menu branch November 4, 2021 21:24
@ghost
Copy link

ghost commented Jan 7, 2022

🎉 v2.2.0-beta5 has been released which incorporates this pull request. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Menu completion doesn't work properly when scrolling happens Tab autocomplete in a Cmdlet param context
2 participants