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:
parent
7f166298db
commit
d68d858a10
2 changed files with 68 additions and 4 deletions
|
@ -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())))
|
||||
}),
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue