Fix handling of empty blocks in BlockMap::chunks (#25031)
Closes https://github.com/zed-industries/zed/issues/23391 Release Notes: - Fixed a bug that sometimes caused incorrect syntax highlighting when deploying the inline assistant.
This commit is contained in:
parent
69477dfd8c
commit
1e1b637b50
2 changed files with 31 additions and 16 deletions
|
@ -2070,18 +2070,30 @@ pub mod tests {
|
|||
)
|
||||
});
|
||||
|
||||
// Insert a block in the middle of a multi-line string literal
|
||||
// Insert two blocks in the middle of a multi-line string literal.
|
||||
// The second block has zero height.
|
||||
map.update(cx, |map, cx| {
|
||||
map.insert_blocks(
|
||||
[BlockProperties {
|
||||
placement: BlockPlacement::Below(
|
||||
buffer_snapshot.anchor_before(Point::new(1, 0)),
|
||||
),
|
||||
height: 1,
|
||||
style: BlockStyle::Sticky,
|
||||
render: Arc::new(|_| div().into_any()),
|
||||
priority: 0,
|
||||
}],
|
||||
[
|
||||
BlockProperties {
|
||||
placement: BlockPlacement::Below(
|
||||
buffer_snapshot.anchor_before(Point::new(1, 0)),
|
||||
),
|
||||
height: 1,
|
||||
style: BlockStyle::Sticky,
|
||||
render: Arc::new(|_| div().into_any()),
|
||||
priority: 0,
|
||||
},
|
||||
BlockProperties {
|
||||
placement: BlockPlacement::Below(
|
||||
buffer_snapshot.anchor_before(Point::new(2, 0)),
|
||||
),
|
||||
height: 0,
|
||||
style: BlockStyle::Sticky,
|
||||
render: Arc::new(|_| div().into_any()),
|
||||
priority: 0,
|
||||
},
|
||||
],
|
||||
cx,
|
||||
)
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue