Better bias selection for hints that prefix the type

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
This commit is contained in:
Kirill Bulatov
2023-06-29 22:25:49 +03:00
co-authored by Antonio Scandurra
parent 2b1b1225f5
commit 63074c5cd8
4 changed files with 79 additions and 42 deletions
+4
View File
@@ -49,6 +49,10 @@ impl Anchor {
}
}
pub fn bias(&self) -> Bias {
self.text_anchor.bias
}
pub fn bias_left(&self, snapshot: &MultiBufferSnapshot) -> Anchor {
if self.text_anchor.bias != Bias::Left {
if let Some(excerpt) = snapshot.excerpt(self.excerpt_id) {