text: Assert text anchor offset validity on construction (#38441)
Attempt to aid debugging some utf8 indexing issues Release Notes: - N/A Co-authored-by: Mikayla Maki <mikayla@zed.dev>
This commit is contained in:
co-authored by
Mikayla Maki
parent
79620454d0
commit
a2c71d3d20
@@ -29,7 +29,9 @@ pub fn refresh_matching_bracket_highlights(
|
||||
if (editor.cursor_shape == CursorShape::Block || editor.cursor_shape == CursorShape::Hollow)
|
||||
&& head < snapshot.buffer_snapshot.len()
|
||||
{
|
||||
tail += 1;
|
||||
if let Some(tail_ch) = snapshot.buffer_snapshot.chars_at(tail).next() {
|
||||
tail += tail_ch.len_utf8();
|
||||
}
|
||||
}
|
||||
|
||||
if let Some((opening_range, closing_range)) = snapshot
|
||||
|
||||
Reference in New Issue
Block a user