# Fix text transformation commands for multiple line, single selection cases \(\#3060\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/3cf7164a5406854a18ad641992a1178f68135526)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 3cf7164a5406854a18ad641992a1178f68135526

Requested commit: 3cf7164a5406854a18ad641992a1178f68135526

Commit: 3cf7164a5406854a18ad641992a1178f68135526

Tree: 8692872cba57eab6bfc46c21f155e6584fce57e4

Author: Joseph T\. Lyons

Committer: GitHub

## Message

````
Fix text transformation commands for multiple line, single selection 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](https://github.com/rutrum/convert-case/issues/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.
````

## Parents

- [a8188a2f337bf958b9df4429647556f039084d4b](https://git.cafe/gitcafe/zed/commit/a8188a2f337bf958b9df4429647556f039084d4b?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/3cf7164a5406854a18ad641992a1178f68135526?format=markdown)
