zed
zed copied to clipboard
editor: Fix panic when full width crease is wrapped
Closes #31919
Release Notes:
- Fixed a panic that could sometimes occur when the agent panel was too narrow and contained context included via
@.
This change has one side effect (which might actually be desirable):
When a diagnostic is wrapped we do not underline the whitespace in a newline anymore.
Previously:
The least invasive way to fix this would be to only set renderer to None.
return Some(Chunk {
text: &display_text[start_ix..end_ix],
renderer: None,
..self.input_chunk.clone()
});
test_chunks_with_soft_wrapping is failing with:
assertion `left == right` failed
left: [("fn \n", None), ("oute", Some(Hsla { h: 0.6666667, s: 1.0, l: 0.5, a: 1.0 })), ("\n", None), ("r", Some(Hsla { h: 0.6666667, s: 1.0, l: 0.5, a: 1.0 })), ("() \n{}\n\n", None)]
right: [("fn \n", None), ("oute\nr", Some(Hsla { h: 0.6666667, s: 1.0, l: 0.5, a: 1.0 })), ("() \n{}\n\n", None)]
Which is expected, as documented above. The tests can be adjusted to the new behaviour with: test_fixes.patch
/cherry-pick v0.189.x