editor: Add rewrap command (#17909)

This PR adds a rewrap command to the editor.

Executing this command will rewrap the text in the selection to the
maximum line width:


https://github.com/user-attachments/assets/69aa9428-17fd-4315-89f1-f354d0f5f459

If there isn't an active selection, the selection will be expanded to
contiguous text from the cursor's location.

Rewrapping only works in Markdown, Plain Text, and within comments for
any other language.

Release Notes:

- Added an `editor: rewrap` command for rewrapping text to the maximum
line width.

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Bennet <bennet@zed.dev>
This commit is contained in:
Marshall Bowers
2024-09-16 19:58:22 -04:00
committed by GitHub
co-authored by Antonio Scandurra Bennet
parent e7d18ef359
commit b54b3d6246
6 changed files with 399 additions and 0 deletions
Generated
+1
View File
@@ -3708,6 +3708,7 @@ dependencies = [
"serde",
"serde_json",
"settings",
"similar",
"smallvec",
"smol",
"snippet",