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-12 11:32:41 +03:00
parent 2b1b1225f5
commit 63074c5cd8
4 changed files with 79 additions and 42 deletions

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) {