zed/crates/editor
Om Chillure 7a61562845
Fix title/camelCase commands stripping leading indentation Fixes (#50523)
Fixes: #48945

Description:

The convert:to-title-case, convert:to-upper-camel-case, and
convert:to-lower-camel-case editor commands were stripping leading
whitespace from each line of a multi-line selection.

Root cause: The conversion functions split on whitespace using
.split_whitespace() and then joined the resulting words, discarding any
leading spaces/tabs before the first word on each line.

Fix: Each line now preserves its leading whitespace by capturing and
re-prepending it before applying the case conversion.

Tests: Added test cases covering multi-line selections with indentation
for all three commands.

Video : 


[bug1fix.webm](https://github.com/user-attachments/assets/f4d25c55-bc6d-44e6-a989-7d9b4bc59ac9)

Release Notes:

- Fixed trailing whitespace handling on text case changes
2026-03-12 19:33:48 +00:00
..
benches Revert "Revert scheduler update (#46659)" (#46671) 2026-01-14 07:19:13 +00:00
src Fix title/camelCase commands stripping leading indentation Fixes (#50523) 2026-03-12 19:33:48 +00:00
Cargo.toml Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
LICENSE-GPL