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

Windows: Make the Ctrl+RightArrow key accepts the next suggestion word in addition to its default by-word movement. #4290

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sangafabrice
Copy link

@sangafabrice sangafabrice commented Nov 23, 2024

PR Summary

  • Modify the NextWord handler to accept the next suggestion word for consistently using the Ctrl+RightArrow key
  • The Ctrl+RightArrow now moves the cursor word-by-word for both editing the line and accepting suggestions
  • Before, the NextWord handler did not operate on the suggestion text when the cursor was at the end of the line
  • NextWord is now an alternative to the less consistent custom binding ForwardCharAndAcceptNextSuggestionWord defined in the SamplePSReadlineProfile.ps1 script
  • ForwardCharAndAcceptNextSuggestionWord is less consistent because it mixes word movement, line movement, and character movement in a single key
  • NextWord is now consistent because the Ctrl+RightArrow key moves the cursor uniformly in the editing and suggestion cases
  • Documentation is not needed at PowerShell-Docs because NextWord is not in the list of the advertised functions
  • This commit is a feature addition, and it does not impact the previous use of the Ctrl+RightArrow key in Windows

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
  • 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

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.

1 participant