Remove more references to 'model' in GPUI APIs (#23693)

Release Notes:

- N/A
This commit is contained in:
Mikayla Maki 2025-01-26 20:00:27 -08:00 committed by GitHub
parent a6b1514246
commit 9cae96f82f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
115 changed files with 309 additions and 311 deletions

View file

@ -245,7 +245,7 @@ impl Vim {
const NAMESPACE: &'static str = "vim";
pub fn new(window: &mut Window, cx: &mut Context<Editor>) -> Entity<Self> {
let editor = cx.model().clone();
let editor = cx.entity().clone();
cx.new(|cx| Vim {
mode: Mode::Normal,
@ -377,7 +377,7 @@ impl Vim {
editor.unregister_addon::<VimAddon>();
editor.set_relative_line_number(None, cx);
if let Some(vim) = Vim::globals(cx).focused_vim() {
if vim.entity_id() == cx.model().entity_id() {
if vim.entity_id() == cx.entity().entity_id() {
Vim::globals(cx).focused_vim = None;
}
}
@ -398,7 +398,7 @@ impl Vim {
}
pub fn workspace(&self, window: &mut Window) -> Option<Entity<Workspace>> {
window.root_model::<Workspace>().flatten()
window.root::<Workspace>().flatten()
}
pub fn pane(&self, window: &mut Window, cx: &mut Context<Self>) -> Option<Entity<Pane>> {
@ -797,7 +797,7 @@ impl Vim {
if VimSettings::get_global(cx).toggle_relative_line_numbers {
if let Some(old_vim) = Vim::globals(cx).focused_vim() {
if old_vim.entity_id() != cx.model().entity_id() {
if old_vim.entity_id() != cx.entity().entity_id() {
old_vim.update(cx, |vim, cx| {
vim.update_editor(window, cx, |_, editor, _, cx| {
editor.set_relative_line_number(None, cx)
@ -816,7 +816,7 @@ impl Vim {
});
}
}
Vim::globals(cx).focused_vim = Some(cx.model().downgrade());
Vim::globals(cx).focused_vim = Some(cx.entity().downgrade());
}
fn blurred(&mut self, window: &mut Window, cx: &mut Context<Self>) {