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

Feat: add support for upcasing, downcasing, and capitalizing word #3365

Merged
merged 2 commits into from
Jul 18, 2022

Conversation

3N4N
Copy link
Contributor

@3N4N 3N4N commented Jul 2, 2022

PR Summary

Closes #2912

GNU Readline provides functionalities which let the user change the case of the word in front of the cursor. They can change the word to upper case or lower case, or they can capitalize it. The keybindings by default provided are as follows.

bind '"\ec": capitalize-word'    # default is alt-c
bind '"\eu": upcase-word'     # default is alt-u
bind '"\el": downcase-word'  # default is alt-l

This PR brings that functionality to PSReadLine.

The newly added bindable functions are in the "Basic editing functions" section:

  • CapitalizeWord, bound to Alt+c and Escape,c in Emacs mode
  • DowncaseWord, bound to Alt+l and Escape,l in Emacs mode
  • UpcaseWord, bound to Alt+u and Escape,u in Emacs mode

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
    • conhost.exe (with MockPSConsole)
    • Windows Terminal (with MockPSConsole)
    • Visual Studio Code Integrated Terminal
  • User-facing changes
Microsoft Reviewers: Open in CodeFlow

@ghost
Copy link

ghost commented Jul 2, 2022

CLA assistant check
All CLA requirements met.

@3N4N
Copy link
Contributor Author

3N4N commented Jul 2, 2022

@lzybkr Hi, again. Some of the requirements have not been fulfilled (writing tests, adding docs). I need help with that. And being unfamiliar with the codebase, what I've come up with must be riddled with bugs. Need review on the actual code, too. You understand.

@lzybkr lzybkr requested a review from daxian-dbw July 5, 2022 18:05
@lzybkr
Copy link
Member

lzybkr commented Jul 5, 2022

@3N4N - thanks for the contribution - @daxian-dbw is the PSReadLine maintainer now.

@3N4N
Copy link
Contributor Author

3N4N commented Jul 8, 2022

Any chance of it getting reviewed? An update would be nice.

@daxian-dbw
Copy link
Member

@3N4N thanks for submitting the PR, we will review it the next Monday. Every Monday is our community day, where we focus on PRs and issues.

@3N4N
Copy link
Contributor Author

3N4N commented Jul 8, 2022

Thanks.

@3N4N 3N4N force-pushed the feat/casing branch 2 times, most recently from ac0734d to baef10d Compare July 12, 2022 15:02
@3N4N
Copy link
Contributor Author

3N4N commented Jul 12, 2022

All suggestions except the tests have been committed. I'll get to the tests soon.

@3N4N
Copy link
Contributor Author

3N4N commented Jul 13, 2022

@daxian-dbw All suggestions committed. Tests for all three functions added.

@3N4N 3N4N requested a review from daxian-dbw July 15, 2022 17:49
Copy link
Member

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
I pushed a commit to fix up a few minor issues, and also added descriptions for the new public functions.

@daxian-dbw daxian-dbw merged commit 6808c18 into PowerShell:master Jul 18, 2022
@3N4N
Copy link
Contributor Author

3N4N commented Jul 18, 2022

Thanks @daxian-dbw for the merge.

michaeltlombardi added a commit to michaeltlombardi/PowerShell-Docs that referenced this pull request Jul 18, 2022
The change in PowerShell/PSReadLine#3365 added three new functions for
modifying the casing of text with PSReadLine. This change:

- Adds an entry for each new function in the "Basic editing functions"
  section of `about_PSReadLine_Functions.md`
- Resolves MicrosoftDocs#9033
- Resolves AB#4387
sdwheeler pushed a commit to MicrosoftDocs/PowerShell-Docs that referenced this pull request Jul 19, 2022
The change in PowerShell/PSReadLine#3365 added three new functions for
modifying the casing of text with PSReadLine. This change:

- Adds an entry for each new function in the "Basic editing functions"
  section of `about_PSReadLine_Functions.md`
- Resolves #9033
- Resolves AB#4387
@3N4N 3N4N deleted the feat/casing branch July 22, 2022 04:48
@ghost
Copy link

ghost commented Mar 8, 2023

🎉 v2.3.0-beta0 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.

Add support for capitalizing, upcasing, and downcasing words
4 participants