Replace app/app_mut on contexts with AsRef/AsMut impls
Co-Authored-By: Brooks Swinnerton <934497+bswinnerton@users.noreply.github.com>
This commit is contained in:
co-authored by
Brooks Swinnerton
parent
7469240a2e
commit
0a2d2aa684
@@ -29,7 +29,7 @@ impl DisplayMap {
|
||||
|
||||
DisplayMap {
|
||||
buffer: buffer.clone(),
|
||||
fold_map: FoldMap::new(buffer, ctx.app()),
|
||||
fold_map: FoldMap::new(buffer, ctx.as_ref()),
|
||||
tab_size,
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ impl DisplayMap {
|
||||
ranges: impl IntoIterator<Item = Range<T>>,
|
||||
ctx: &mut ModelContext<Self>,
|
||||
) -> Result<()> {
|
||||
self.fold_map.fold(ranges, ctx.app())?;
|
||||
self.fold_map.fold(ranges, ctx.as_ref())?;
|
||||
ctx.notify();
|
||||
Ok(())
|
||||
}
|
||||
@@ -49,7 +49,7 @@ impl DisplayMap {
|
||||
ranges: impl IntoIterator<Item = Range<T>>,
|
||||
ctx: &mut ModelContext<Self>,
|
||||
) -> Result<()> {
|
||||
self.fold_map.unfold(ranges, ctx.app())?;
|
||||
self.fold_map.unfold(ranges, ctx.as_ref())?;
|
||||
ctx.notify();
|
||||
Ok(())
|
||||
}
|
||||
@@ -125,7 +125,7 @@ impl DisplayMap {
|
||||
|
||||
fn handle_buffer_event(&mut self, event: &buffer::Event, ctx: &mut ModelContext<Self>) {
|
||||
match event {
|
||||
buffer::Event::Edited(edits) => self.fold_map.apply_edits(edits, ctx.app()).unwrap(),
|
||||
buffer::Event::Edited(edits) => self.fold_map.apply_edits(edits, ctx.as_ref()).unwrap(),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user