Fix crash in BlockMap::sync when there are inlay hints w/ newlines ri… (#25598)
Closes https://github.com/zed-industries/zed/issues/25377 Release Notes: - Fixed a crash that could happen when typing in the assistant panel with edit predictions enabled. --------- Co-authored-by: Cole Miller <m@cole-miller.net>
This commit is contained in:
co-authored by
Cole Miller
parent
7f166298db
commit
d68d858a10
@@ -638,10 +638,13 @@ impl BlockMap {
|
||||
self.custom_blocks[start_block_ix..end_block_ix]
|
||||
.iter()
|
||||
.filter_map(|block| {
|
||||
Some((
|
||||
block.placement.to_wrap_row(wrap_snapshot)?,
|
||||
Block::Custom(block.clone()),
|
||||
))
|
||||
let placement = block.placement.to_wrap_row(wrap_snapshot)?;
|
||||
if let BlockPlacement::Above(row) = placement {
|
||||
if row < new_start {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
Some((placement, Block::Custom(block.clone())))
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user