# editor: Preserve the trailing newline when converting case \(\#63463\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 91c57e81470e760f90d1f04f771577bfc09b39c7

Requested commit: 91c57e81470e760f90d1f04f771577bfc09b39c7

Commit: 91c57e81470e760f90d1f04f771577bfc09b39c7

Tree: abb5d08fa52aa8599022801569f4726a2bc18afa

Author: Ali

Committer: GitHub

## Message

````
editor: Preserve the trailing newline when converting case (#63463)

# Objective
Case conversion commands deleted the newline at the end of the
selection,
merging the selected line into the line below it.

To reproduce:

1. A buffer with two lines:

   ```
   hello world
   goodbye
   ```

2. Put the cursor on line 1 and run `editor: select line` — this selects
   `hello world\n`, newline included.
3. Run `editor: convert to upper camel case`.

Before: `HelloWorldgoodbye`, one line. After: `HelloWorld` / `goodbye`.

## Testing

Added a regression test to `test_manipulate_text`.


Release Notes:
- Fixed the case conversion commands deleting the line break when the
selection
  ended at the start of the next line.
````

## Parents

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

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