ZIm/crates/editor/src
Joseph T. Lyons 3cf7164a54
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.
2023-09-28 14:04:17 -04:00
..
display_map Combine both text and inlay highlights in randomized tests 2023-09-14 23:53:56 +03:00
multi_buffer Fix more inlay_map corner cases and hangings 2023-06-29 22:25:49 +03:00
scroll vim: Fix ctrl-u/ctrl-d 2023-09-26 22:28:04 -06:00
test tests: wait deterministically after simulating_keystrokes 2023-09-20 20:44:26 -06:00
blink_manager.rs Do not blink the cursor if Zed window is focused away 2023-08-29 21:33:03 +03:00
display_map.rs Restructure inlay highlights data for proper access 2023-09-14 23:05:22 +03:00
editor.rs Fix text transformation commands for multiple line, single selection cases (#3060) 2023-09-28 14:04:17 -04:00
editor_settings.rs Add relative_line_mode 2023-08-25 11:50:41 -06:00
editor_tests.rs Fix text transformation commands for multiple line, single selection cases (#3060) 2023-09-28 14:04:17 -04:00
element.rs Unify icons using multiple variants, remove all unused icons 2023-09-15 12:50:49 -04:00
git.rs Rearrange git tests in worktree 2023-05-19 16:30:00 -07:00
highlight_matching_bracket.rs Define language settings in the language crate 2023-05-16 17:29:53 -07:00
hover_popover.rs Uncomment the rest of the tests 2023-09-14 22:18:26 +03:00
inlay_hint_cache.rs Tone down inlay hint update logs 2023-09-22 17:04:11 +03:00
items.rs editor: Start transaction in replace impl (#3036) 2023-09-26 19:21:15 +02:00
link_go_to_definition.rs Improve inlay hint cache lookup 2023-09-14 23:31:50 +03:00
mouse_context_menu.rs Define language settings in the language crate 2023-05-16 17:29:53 -07:00
movement.rs Merge branch 'main' into vim-softwrap-word 2023-09-01 12:23:56 -06:00
multi_buffer.rs Extract code generation logic into its own module 2023-09-11 11:25:37 +02:00
persistence.rs wip 2023-01-25 11:32:19 -08:00
scroll.rs Split ContextMenu actions 2023-09-02 21:04:19 -06:00
selections_collection.rs Vim visual block mode 2023-08-15 16:00:50 -06:00
test.rs Fix typos 2023-06-02 22:02:19 -04:00