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 text transformation commands for multiple line, single selection cases #3060

Conversation

JosephTLyons
Copy link
Contributor

@JosephTLyons JosephTLyons commented Sep 28, 2023

If you highlight the following block of text (with a single selection):

The quick brown
fox jumps over
the lazy dog

and run editor: convert to upper camel case, you'll get:

TheQuickBrown
foxJumpsOver
theLazyDog

instead of:

TheQuickBrown
FoxJumpsOver
TheLazyDog

The same thing happens for editor: convert to title case. This happens because to_case crate doesn't allow the user to define '\n' as a boundary. I wanted to fix this at the lib level, so I filled an issue but I never heard back. What's strange is VS Code and Sublime I think both exhibit the same output as we do currently, but I don't personally think this feels right (happy to hear opposing opinions). I'm just doing the naive thing to hack around this limitation of the to_case crate.

I did some testing and it seems I only need to adjust editor: convert to title case and editor: convert to upper camel case. The way the other transformations are implemented in to_case don't seem to have this issue.

Release Notes:

  • Fixed a bug where running certain text transfomration commands on a single selection covering multiple lines would not transform all selected lines as expected.

@JosephTLyons JosephTLyons merged commit 3cf7164 into main Sep 28, 2023
3 checks passed
@JosephTLyons JosephTLyons deleted the fix-text-transformation-commands-for-multiple-line-single-selection-cases branch September 28, 2023 18:04
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