editor: Improve rewrap of markdown lists, todos, and block quotes (#33702)

Closes #19644 #18151

Now, rewrapping markdown lists (unordered, ordered, and to-do lists) and
block quotes wrap them separately, without merging them together.
Additionally, it correctly indents subsequent lines.

With this input: 

```md
1. This is a list item that is short.
2. This list item is a bit longer because I want to see if it wraps correctly after a rewrap operation in Zed. What do you think?
3. another short item
```

Output would be:

```md
1. This is a list item that is short.
2. This list item is a bit longer because I want to see if it wraps correctly
   after a rewrap operation in Zed. What do you think?
3. another short item
```

Instead of:

```md
1. This is a list item that is short. 2. This list item is a bit longer because 
I want to see if it wraps correctly after a rewrap operation in Zed. What 
do you think? 3. another short item
```

Release Notes:

- Improved rewrap for markdown lists, todos, and block quotes.
This commit is contained in:
Smit Barmase 2025-07-01 15:34:39 +05:30 committed by GitHub
parent 0d809c21ba
commit 8fb3199a84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 256 additions and 61 deletions

View file

@ -13,6 +13,12 @@ brackets = [
{ start = "'", end = "'", close = false, newline = false },
{ start = "`", end = "`", close = false, newline = false },
]
rewrap_prefixes = [
"[-*+]\\s+",
"\\d+\\.\\s+",
">\\s*",
"[-*+]\\s+\\[[\\sx]\\]\\s+"
]
auto_indent_on_paste = false
auto_indent_using_last_non_empty_line = false