highlight both brackets, only when empty selection, and add test

This commit is contained in:
Keith Simmons 2022-07-05 15:19:05 -07:00
parent 9b36e3d009
commit 1f3dc2f534
6 changed files with 201 additions and 50 deletions

View file

@ -5372,7 +5372,7 @@ impl Editor {
.map(|h| &h.1);
let write_highlights = self
.background_highlights
.get(&TypeId::of::<DocumentHighlightRead>())
.get(&TypeId::of::<DocumentHighlightWrite>())
.map(|h| &h.1);
let left_position = position.bias_left(buffer);
let right_position = position.bias_right(buffer);
@ -10281,3 +10281,13 @@ impl<T: Ord + Clone> RangeExt<T> for Range<T> {
self.start.clone()..=self.end.clone()
}
}
trait RangeToAnchorExt {
fn to_anchors(self, snapshot: &MultiBufferSnapshot) -> Range<Anchor>;
}
impl<T: ToOffset> RangeToAnchorExt for Range<T> {
fn to_anchors(self, snapshot: &MultiBufferSnapshot) -> Range<Anchor> {
snapshot.anchor_after(self.start)..snapshot.anchor_before(self.end)
}
}