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
@@ -5259,7 +5259,8 @@ impl MultiBufferSnapshot {
|
||||
} else {
|
||||
Anchor::max()
|
||||
};
|
||||
// TODO this is a hack, remove it
|
||||
|
||||
// TODO this is a hack, because all APIs should be able to handle ExcerptId::min and max.
|
||||
if let Some((excerpt_id, _, _)) = self.as_singleton() {
|
||||
anchor.excerpt_id = *excerpt_id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user