Start making MultiBuffer work with a singleton buffer

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2021-12-10 18:04:11 +01:00
parent 7524974f19
commit 5b31c1ba4e
2 changed files with 122 additions and 22 deletions

View file

@ -3035,7 +3035,7 @@ impl Editor {
let range = (range.start.to_offset(&display_map, Bias::Left), Bias::Left)
..(range.end.to_offset(&display_map, Bias::Left), Bias::Right);
buffer
.selection_set(set_id)
.selection_set(set_id, cx)
.unwrap()
.intersecting_selections::<Point, _>(range, &buffer.read(cx))
.map(move |s| Selection {
@ -3131,7 +3131,7 @@ impl Editor {
fn selection_set<'a>(&self, cx: &'a AppContext) -> &'a SelectionSet {
self.buffer
.read(cx)
.selection_set(self.selection_set_id)
.selection_set(self.selection_set_id, cx)
.unwrap()
}