Introduce custom fold placeholders (#12214)

This pull request replaces the static `⋯` character we used to insert
when folding a range with a custom render function that return an
`AnyElement`. We plan to use this in the assistant, but for now this
should be behavior-preserving.

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
Antonio Scandurra 2024-05-23 23:22:30 +02:00 committed by GitHub
parent e0cfba43aa
commit 57d570c281
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 774 additions and 437 deletions

View file

@ -251,12 +251,10 @@ impl Editor {
let end_column = cmp::min(display_map.line_len(head.row()), head.column() + 3);
target_left = target_left.min(
layouts[head.row().minus(start_row) as usize]
.line
.x_for_index(start_column as usize),
);
target_right = target_right.max(
layouts[head.row().minus(start_row) as usize]
.line
.x_for_index(end_column as usize)
+ max_glyph_width,
);