Skip to content

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

Open
Fabrice Sanga (sangafabrice) wants to merge 1 commit into
PowerShell:masterfrom
sangafabrice:nextword-accept-suggestion
Open

Windows: Make the Ctrl+RightArrow key accepts the next suggestion word in addition to its default by-word movement.#4290
Fabrice Sanga (sangafabrice) wants to merge 1 commit into
PowerShell:masterfrom
sangafabrice:nextword-accept-suggestion

Conversation

@sangafabrice

@sangafabrice Fabrice Sanga (sangafabrice) commented Nov 23, 2024

Copy link
Copy Markdown
Contributor

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

1 participant