-
Notifications
You must be signed in to change notification settings - Fork 10
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
Is there a way to specify \n
as a boundary?
#16
Comments
…cases (#3060) 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](https://crates.io/crates/convert_case) 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](rutrum/convert-case#16) 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.
This is not a feature at this time. You can only split a string based on a boundary condition, which is currently fixed to whatever is currently in Boundary, which doesn't include a generic "character" option. This should definitely be an option. I'd like to keep this issue open until it is fully investigated. For now, you would need to manually split the string before hand. |
Manually splitting is what I ended up doing. Appreciate the response. |
I'm trying to use
Case::Title
on some text that contains a newline (ex:The big\nblue house
), but the newline isn't counted as a boundary, so I getThe Big\nblue House
. Is there a way to specify newlines as boundarys so I can getThe Big\nBlue House
? Thanks.I tried doing something like:
But I didn't have any luck with this.
The text was updated successfully, but these errors were encountered: