Store an AnyWindowHandle in WindowContext

This commit is contained in:
Nathan Sobo 2023-08-08 11:08:37 -06:00
parent 49f1f1c6c2
commit d896d89842
19 changed files with 526 additions and 559 deletions

View file

@ -135,16 +135,14 @@ impl Entity for GoToLine {
fn release(&mut self, cx: &mut AppContext) {
let scroll_position = self.prev_scroll_position.take();
if let Some(window) = self.active_editor.window(cx) {
window.update(cx, |cx| {
self.active_editor.update(cx, |editor, cx| {
editor.highlight_rows(None);
if let Some(scroll_position) = scroll_position {
editor.set_scroll_position(scroll_position, cx);
}
})
});
}
self.active_editor.window().update(cx, |cx| {
self.active_editor.update(cx, |editor, cx| {
editor.highlight_rows(None);
if let Some(scroll_position) = scroll_position {
editor.set_scroll_position(scroll_position, cx);
}
})
});
}
}